mirror of
https://gitea.invidious.io/iv-org/shard-kemal.git
synced 2024-08-08 21:57:09 +00:00
12 lines
276 B
Crystal
12 lines
276 B
Crystal
require "kemal"
|
|
require "json"
|
|
|
|
# You can easily access the context and set content_type like 'application/json'.
|
|
# Look how easy to build a JSON serving API.
|
|
get "/" do |env|
|
|
env.response.content_type = "application/json"
|
|
{name: "Serdar", age: 27}.to_json
|
|
end
|
|
|
|
Kemal.run
|