Last active
August 29, 2015 14:23
-
-
Save metame/577fea61c7311e27043a to your computer and use it in GitHub Desktop.
barebones express http server to serve Angular files
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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