Skip to content

Instantly share code, notes, and snippets.

@andreareginato
Created April 15, 2013 10:48
Show Gist options
  • Select an option

  • Save andreareginato/5387274 to your computer and use it in GitHub Desktop.

Select an option

Save andreareginato/5387274 to your computer and use it in GitHub Desktop.
Express static server for angular apps
var express = require("express");
var app = express();
app.configure(function(){
app.use(express.static(__dirname + '/dist'));
});
app.all('/*', function(req, res) {
res.sendfile('index.html', { root: __dirname + '/dist' });
});
app.listen(3000);
console.log("Express server listening on port %d in %s mode");
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment