Skip to content

Instantly share code, notes, and snippets.

@metame
Last active August 29, 2015 14:23
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 metame/577fea61c7311e27043a to your computer and use it in GitHub Desktop.
Save metame/577fea61c7311e27043a to your computer and use it in GitHub Desktop.
barebones express http server to serve Angular files
var express = require('express'),
app = express(),
path = require('path'),
port = process.env.PORT || 8000;
// Place all angular files in /app directory
app.use(express.static(path.join(__dirname,'/app')));
// Require any bower dependencies in html files at 'localhost:port/bower_components/*'
app.use('/bower_components', express.static(path.join(__dirname,'/bower_components')));
app.listen(port, function(){
console.log('Server started at %s', port);
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment