How to deploy Angular universal
I looking into Angular universal and trying to get my head around deployment. Github https://github.com/angular/universal-starter
It has Angular 2 Universal + TypeScript 2 + Webpack 2
When I run the command
npm run build
I get the following structure
**Client**
0.bundle
0.bundle.js.map
main.bundle
main.bundle.js.map
**Server**
0.index
0.index.js.map
index
index.js.map
How do I deploy this to a server?
Install dependencies
Run npm install
in your terminal at the root of universal-starter
Run the NodeJS backend
Run npm run build:ssr && npm run serve:ssr
after npm install has finished, this will host a local nodejs server here: http://localhost:4000 (you can put that in your browser)
Before either of these steps ensure you have NodeJS and NPM installed (NPM comes with the newer builds of NodeJS)
链接地址: http://www.djcxy.com/p/31334.html上一篇: 角色4应用程序的服务器端渲染不起作用
下一篇: 如何部署Angular通用