Created
June 28, 2013 22:36
-
-
Save enotodden/5888700 to your computer and use it in GitHub Desktop.
Turbo 'Hello World'.
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") | |
-- Create a new requesthandler with a method get() for HTTP GET. | |
local HelloWorldHandler = class("HelloWorldHandler", turbo.web.RequestHandler) | |
function HelloWorldHandler:get() | |
self:write("Hello World!") | |
end | |
-- Create an Application object and bind our HelloWorldHandler to the route '/hello'. | |
local application = turbo.web.Application:new({ | |
{"/hello", HelloWorldHandler} | |
}) | |
-- Set the server to listen on port 8888 and start the ioloop. | |
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