Skip to content

Instantly share code, notes, and snippets.

@zefhemel
Created October 31, 2011 10:53
Show Gist options
  • Select an option

  • Save zefhemel/1327275 to your computer and use it in GitHub Desktop.

Select an option

Save zefhemel/1327275 to your computer and use it in GitHub Desktop.
Hello world with delay node.js
var http = require('http');
var server = http.createServer(function (req, res) {
res.writeHead(200, {'Content-Type': 'text/plain'});
res.write('Hello\n');
setTimeout(function() {
res.end('World\n');
}, 1000);
});
server.listen(process.env.C9_PORT, "0.0.0.0");
console.log('Server running!');
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment