Home:ALL Converter>Using express to serve an Angular app

Using express to serve an Angular app

Ask Time:2017-07-28T09:44:24         Author:Jordan McDonald

Json Formatter

I planning to serve my Angular index.html with express.

Is it possible to make a call to service which can populate a node model. Then pass this model value to index.html.

For example, I call a service from a trusted source within our compnay that gives me back a few files which I will write to the index file.

I could do this in JavaScript with index.html at runtime, but I think it woud be better if the node server did this as it bootstrapped and served the index.html.

I cannot seem to find how this is done or a common approach.

I have done this before in a .NET/Angular app but this Node/Express is a new approach for me.

thanks

Author:Jordan McDonald,eproduced under the CC 4.0 BY-SA copyright license with a link to the original source and this disclaimer.
Link to original article:https://stackoverflow.com/questions/45363575/using-express-to-serve-an-angular-app
yy