Created
December 29, 2015 20:44
-
-
Save lucasalmeida92/7f67f5183318d44f348b to your computer and use it in GitHub Desktop.
html5mode + ionic (express server for production)
This file contains 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
// Set up ================================= | |
var express = require('express'); | |
var app = express(); | |
// Constants ================================= | |
var PORT = 8100; | |
// Config ================================= | |
app.use(express.static(__dirname + '/www')); | |
// Routes ================================= | |
app.all('*', function (req, res, next) { | |
// Just send the index.html for other files to support HTML5Mode | |
res.sendFile('www/index.html', { root: __dirname }); | |
}); | |
// Listen ================================= | |
app.listen(PORT); | |
console.log('\n\n•••••••••••••••••••••••••••••••••••••\n Running on http://localhost:' + PORT + '\n••••••••••••••••••••••••••••••••••••••••••\n :) \n\n'); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment