Skip to content

Instantly share code, notes, and snippets.

@robertklep
Created March 10, 2013 06:50
Show Gist options
  • Save robertklep/5127432 to your computer and use it in GitHub Desktop.
Save robertklep/5127432 to your computer and use it in GitHub Desktop.
Hello World for gunicorn and Node.js
# 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