Skip to content

Instantly share code, notes, and snippets.

@oeeckhoutte
Last active December 10, 2015 21:38
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save oeeckhoutte/4496322 to your computer and use it in GitHub Desktop.
Save oeeckhoutte/4496322 to your computer and use it in GitHub Desktop.
[Node] Simple Node.js Server using Express 3.0
/**
* Module dependencies.
*/
var express = require('express');
var app = express();
// Configuration
app.configure(function(){
app.use(express.bodyParser());
app.use(express.methodOverride());
app.use(express.static('www'));
});
app.configure('development', function() {
app.use(express.errorHandler({ dumpExceptions: true, showStack: true }));
});
app.get('/hello', function(req, res) {
res.send('Hello World');
});
app.configure('production', function(){
app.use(express.errorHandler());
});
app.listen(3000);
console.log("Express server listening on port 3000");
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment