Created
March 10, 2013 06:50
-
-
Save robertklep/5127432 to your computer and use it in GitHub Desktop.
Hello World for gunicorn and Node.js
This file contains hidden or 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
# both tested with: httperf --hog --server 127.0.0.1 --port 8012 --num-conn 100 --num-calls 100 | |
# gunicorn -k gevent -b 0.0.0.0:8012 app:application | |
def application(environ, start_response): | |
status = '200 OK' | |
res = "Hello world!" | |
response_headers = [ | |
('Content-type','text/plain'), | |
('Content-Length',str(len(res)))] | |
start_response(status, response_headers) | |
yield res | |
# return [res] | |
# node app.js | |
var express = require('express'); | |
var app = express(); | |
app.get('/', function(req, res) { | |
res.send("Hello world!"); | |
}); | |
app.listen(8012); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment