Jak to zrobić, że mam zasoby w Sinatrze http://localhost:port/resource.json ??
Odpowiedzi:
2 dla odpowiedzi № 1Zainstaluj klejnot json:
sudo gem install json
to po prostu
require "json"
get "/resource.json" do
content_type :json
{ :name => "Michal", :location => "unknown" }.to_json
end