解决以上问题
首先,您需要为端口4200共享Spring引导资源。使用要共享的资源的 注释类或方法。
您必须在角度应用程序中配置代理。因此,在有角度的根应用程序中创建一个proxy.json文件。内容在下面
{
“/api/*”: { “target”: “http://localhost:8080", “secure”: “false”, “logLevel”: “debug”, “changeOrigin”: true }
}
building modules 3/3 modules 0 active[HPM] Proxy created: /api ->
http://localhost:8080 Subscribed to http-proxy events: [ ‘error’, ‘close’ ]