Last active
August 10, 2017 17:18
-
-
Save davideast/9b646ce78c325a19247786e292f919b3 to your computer and use it in GitHub Desktop.
Angular Universal Server
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
import { angularUniversal } from 'angular-universal-express'; | |
import * as express from 'express'; | |
const app = express(); | |
// serving static requests | |
app.use(express.static(__dirname + '/static')); | |
// serving dynamic requests | |
app.get('/*', angularUniversal({ | |
index: __dirname + '/index.html', | |
main: __dirname + '/main.<your-hash>.bundle', | |
enableProdMode: true | |
})); | |
app.listen(3005, () => { console.log('Listening on 3005'); }); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment