Skip to content

Instantly share code, notes, and snippets.

@timbergus
Created June 22, 2013 14:14
Show Gist options
  • Select an option

  • Save timbergus/5841018 to your computer and use it in GitHub Desktop.

Select an option

Save timbergus/5841018 to your computer and use it in GitHub Desktop.
This is the basic structure to create a node server with express.
var express = require('express');
var app = express();
app.get('/', function(request, response) {
response.send('<h1>Hello World!</h1>');
});
var port = process.env.PORT || 1337;
app.listen(port, function() {
console.log('Server working on http://localhost:' + port);
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment