简体   繁体   English

角度普遍 - 生产问题

[英]Angular-universal - Production Issues

I have created Angular-universal app with reference to this https://github.com/angular/universal-starter . 我已经参考了这个https://github.com/angular/universal-starter创建了Angular-universal应用程序。 I have used node express for server side rendering. 我已经使用node express进行服务器端渲染。

I have build using this command npm run build:prod:ngc, now i got client and server folder in dist folder. 我使用这个命令构建npm run build:prod:ngc,现在我在dist文件夹中得到了客户端和服务器文件夹。 No other files there like index.html. 没有像index.html那样的其他文件。

Previously I developed angular2 app using cli, on building that it create dist folder with bundle.js, index.html and css files. 以前我使用cli开发angular2应用程序,在构建它时使用bundle.js,index.html和css文件创建dist文件夹。 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).. 通用时,你必须先设置服务器,然后启动服务器在某个端口监听(80通常为: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:- 通常..一旦你在托管区域设置节点服务器,你可以转到你的源代码并使用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. 要在端口80上侦听,然后您可以使用IP /域名访问该站点。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM