Skip to content

Instantly share code, notes, and snippets.

@SpeedoPasanen
Created September 1, 2017 19:35
Show Gist options
  • Save SpeedoPasanen/e162adff4191cae3c897e6bc5b7fd605 to your computer and use it in GitHub Desktop.
Save SpeedoPasanen/e162adff4191cae3c897e6bc5b7fd605 to your computer and use it in GitHub Desktop.
// ... pass this to Express or firebase functions.https.onRequest:
function universal(req, res) {
renderModuleFactory(AppServerModuleNgFactory, {
document: index,
url: req.path || '/',
extraProviders: [
{ provide: 'firebaseAdmin', useValue: admin }
]
})
.then(function (html) {
res.send(html);
}).catch(function (e) {
console.log(e)
});
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment