Created
June 30, 2013 00:20
-
-
Save enotodden/5893238 to your computer and use it in GitHub Desktop.
Turbo implicit JSON output example.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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