diff --git a/samples/json_api.cr b/samples/json_api.cr index a10a4e8..54e0598 100644 --- a/samples/json_api.cr +++ b/samples/json_api.cr @@ -4,6 +4,6 @@ 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.content_type = "application/json" + env.response.content_type = "application/json" {name: "Serdar", age: 27}.to_json end