How to properly launch Angular Universal to live server

…衆ロ難τιáo~ 提交于 2019-11-29 15:49:52

问题


I have my website setup and working by modifying the universal-starter seed found here: https://github.com/angular/universal-starter and I have got my site working (rendering HTML) on the localhost node server, now I have a SSH connection and node installed, now I am here:

And I am not sure where I put my /dist files etc and then start the nodejs server.

NodeJS/npm installed shown here:


回答1:


This was actually easier than it seemed, I just needed to install pm2 with npm so I could make the nodejs process constant, then use RewriteEngine settings in the .htaccess file where I wanted to my angular universal application to render (it was in a subdomain folder) and ensure the port is correct and it linked perfectly and loads html in source allowing proper SEO and indexing



来源:https://stackoverflow.com/questions/47120385/how-to-properly-launch-angular-universal-to-live-server

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!