且构网

分享程序员开发的那些事...
且构网 - 分享程序员编程开发的那些事

当应用程序在外部服务器上运行时,未找到所有请求 (404)

更新时间:2023-10-17 22:16:28

ng build --prod 命令将所有需要的文件推送到 /dist 文件夹下.您只需要在服务器中复制这些文件.

The ng build --prod command pushes all required files under the /dist folder. You just need to copy those files in the server.

如果您想提供 /dist 文件夹中的内容

If you want to serve the content from the /dist folder

  1. 安装angular-http-server
  2. 为应用程序提供 angular-http-server --path dist/