Skip to content

Commit

Permalink
Add two hello benchmark apps
Browse files Browse the repository at this point in the history
  • Loading branch information
creationix committed Aug 29, 2012
1 parent e94548f commit f6fccfc
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 1 deletion.
12 changes: 12 additions & 0 deletions examples/app/server-hello.lua
@@ -0,0 +1,12 @@
local server = require("http").createServer(require('stack').stack(
function (req, res)
res:writeHead(200, {
["Content-Type"] = "text/plain",
["Content-Length"] = 12
})
res:finish("Hello World\n")
end
)):listen(process.env.PORT or 8080, "127.0.0.1")

local address = server:address()
p("http server listening on http://" .. address.address .. ':' .. address.port .. '/')
2 changes: 1 addition & 1 deletion examples/web-app/server-hello.lua
@@ -1,4 +1,4 @@
local server = require('web').createServer("127.0.0.1", 8080, require('cleanup')(function (req, res)
local server = require('web').createServer("127.0.0.1", process.env.PORT or 8080, require('cleanup')(function (req, res)
return res(200, {
["Content-Type"] = "text/plain",
["Content-Length"] = 12
Expand Down

0 comments on commit f6fccfc

Please sign in to comment.