Skip to content

Instantly share code, notes, and snippets.

@FooBarWidget
Created June 1, 2012 07:52
Show Gist options
  • Save FooBarWidget/2850065 to your computer and use it in GitHub Desktop.
Save FooBarWidget/2850065 to your computer and use it in GitHub Desktop.
PhusionPassenger.on('request', function(headers, socket) {
var data =
"Status: 200\r\n" +
"Content-Type: text/html\r\n" +
"\r\n" +
"<h1>Hello Node.js in Passenger</h1>\n";
for (var i = 0; i < headers.keys.length; i++) {
var key = headers.keys[i];
data += key + " = " + headers[key] + "<br>\n";
}
socket.write(new Buffer(data));
socket.destroySoon();
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment