Skip to content

Instantly share code, notes, and snippets.

@metame
Last active Aug 29, 2015
Embed
What would you like to do?
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