<%=
<<-TEMPLATE
require 'cuba'
require 'json'

# If you need extra protection.
# require 'rack/protection'
# Cuba.use Rack::Session::Cookie, secret: Random.new_seed.to_s
# Cuba.use Rack::Protection
# Cuba.use Rack::Protection::RemoteReferrer

# To launch just type: 'rackup' in your console
Cuba.define do
  on get do

    on root do
      data = { first_name: 'Hello', last_name: 'World' }
      res.headers["Content-Type"] = "application/json; charset=utf-8"
      res.write data.to_json
    end
  
  end
end
TEMPLATE
%>

<%=
<<-TEMPLATE
require 'cuba'
require 'json'

# If you need extra protection.
# require 'rack/protection'
# Cuba.use Rack::Protection
# Cuba.use Rack::Protection::RemoteReferrer

# To launch just type: 'rackup' in your console
Cuba.define do
  on get do

    on root do
      data = { first_name: 'Hello', last_name: 'World' }
      res.headers["Content-Type"] = "application/json; charset=utf-8"
      res.write data.to_json
    end
  
  end
end
TEMPLATE
%>

Remove session cookie because it breaks RESTfulness
Remove session cookie because it breaks RESTfulness
