Skip to content

Instantly share code, notes, and snippets.

@davideast
Last active Aug 10, 2017
Embed
What would you like to do?
Angular Universal Server
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