Skip to content
Permalink
Browse files

Add two hello benchmark apps

  • Loading branch information...
creationix committed Aug 29, 2012
1 parent e94548f commit f6fccfcabd1892566e309a8a34bee5a0e9ef449f
Showing with 13 additions and 1 deletion.
  1. +12 −0 examples/app/server-hello.lua
  2. +1 −1 examples/web-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 .. '/')
@@ -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

0 comments on commit f6fccfc

Please sign in to comment.
You can’t perform that action at this time.