Created
April 15, 2013 10:48
-
-
Save andreareginato/5387274 to your computer and use it in GitHub Desktop.
Express static server for angular apps
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"); | |
| 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