Created
June 7, 2016 12:27
-
-
Save deebloo/1619f732ce546ae30e688c2dbe6147b0 to your computer and use it in GitHub Desktop.
A small sample server for SPA apps with compression.
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 fallback = require('express-history-api-fallback'); | |
var express = require('express'); | |
var compress = require('compression'); | |
var app = express(); | |
var root = __dirname + '/dist'; | |
app.use(compress()); | |
app.use(express.static(root)); | |
app.use(fallback('index.html', { root: root })); | |
app.listen(8080); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment