简体   繁体   中英

Deploying an Angular App in Node JS (express) server through http-server

I'm trying to put an angular application in "production" on a local server that is generated by the http-server tool, but it does not return the of the index.html.

I followed these steps ...

  1. ng build --prod (this throws me the project folder for production like this -> "dist / project-erp") 第1步

  2. http-server 第2步

  3. web server第 3 步

Update: So, I changed the base route to "/" but still happening in same situation :/ 更新 1

更新 1.1

经过多次构建项目的测试,在 Express 服务器上启动它的解决方案(它现在有效)是只执行命令“ng build”而不是“ng build --prod”,然后是文件夹“dist / project -erp“将它们放在后端服务器上。

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

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