node.js

I have created Angular-universal app with reference to this https://github.com/angular/universal-starter. I have used node express for server side rendering.

I have build using this command npm run build:prod:ngc, now i got client and server folder in dist folder. No other files there like index.html.

Previously I developed angular2 app using cli, on building that it create dist folder with bundle.js, index.html and css files. I used to upload that particular thing to shared hosting. App was working fine. But in angular universal I am confused. I am stuck how to proceed further for production. I have the shared hosting, Please help me how to host the project in shared hosting.


With universal you have to set up the server first and then start the server to listen at some port(80 normally :P)..

normally.. once you setup the node server on the hosting area, you can just go to your source code and start the server using cmd:-

sudo PORT = 80 npm run server (if ubuntu)

to listen at port 80 and then you can access the site then using IP/domain name.

链接地址: http://www.djcxy.com/p/5298.html

上一篇: Angular Universal不会在服务器端渲染所有内容

下一篇: 的node.js