当 angular 和 spring 引导捆绑在单个 war 中并部署在 tomcat 上时,是否需要 proxy.conf.json 文件

Is proxy.conf.json file required when angular and spring boot bundled in single war and deployed on tomcat

我已将 angular 8 代码和 spring 启动休息服务代码捆绑到一个 war 文件中。在开发过程中(在创建 war 文件之前),一切都很顺利,在 package.json 脚本 => 开始中配置了 proxy.conf.json。当一个请求(/api/)发出时,所有的请求都被proxy.conf.json截获,然后到spring boot server.

我的问题是,当 angular + spring 引导捆绑在单个 war 文件中并部署在 tomcat 上时,是否需要 proxy.conf.json。我使用 Maven 前端插件编译 angular 代码并将其复制到 dist 文件夹中,资源插件将编译代码从 dist 文件夹复制到 spring 启动静态文件夹。现在是完整的 javascript 和其余服务代码。

https://angular.io/guide/build#proxying-to-a-backend-server 的官方文档所述,代理配置文件特定于用于开发 Angular 应用程序的 webpack 开发服务器。

在您的生产环境中不使用也不需要它。