Skip to content

Instantly share code, notes, and snippets.

@enotodden
Created June 30, 2013 00:20
Show Gist options
  • Save enotodden/5893238 to your computer and use it in GitHub Desktop.
Save enotodden/5893238 to your computer and use it in GitHub Desktop.
Turbo implicit JSON output example.
local turbo = require("turbo")
local HelloJSONHandler = class("HelloJSONHandler", turbo.web.RequestHandler)
function HelloJSONHandler:get()
self:write({hello="json"})
end
local application = turbo.web.Application:new({
{"/hello", HelloJSONHandler}
})
application:listen(8888)
turbo.ioloop.instance():start()
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment