角度前端和代理到wildlfy休息服务

问题描述:

我有一个角度前端,使用野蛮提供的休息服务。从角度调用wildfly我使用以下信息安装了代理服务器: angular-cli server - how to proxy API requests to another server?角度前端和代理到wildlfy休息服务

当我现在从我的角度应用程序调用服务时,在wildfly中出现以下错误。 javax.ws.rs.NotFoundException:无法找到完整路径的资源:http://localhost:8080/whatever/rest/entity

在浏览器中调用url可以正常工作。

任何想法?

只是一个建议,它可能是你在最后丢失了一个斜线。

+0

谢谢,但没有帮助:javax.ws.rs.NotFoundException:无法找到完整路径的资源:http:// localhost:8080/whatever/rest/entity / – fuechsle

现在我找到了解决办法:

proxy.config.json

{ 
    "/**api**": { 
     "target": "http://localhost:8080/whatever/rest", 
     "secure": false, 
     "changeOrigin": true 
    } 
} 

这样的代理转发你http://localhost:8080/whatever/rest/api/entity

我想API不重视。

所以我改成了这样:

{ 
    "/**rest**": { 
     "target": "http://localhost:8080/whatever/", 
     "secure": false, 
     "changeOrigin": true 
    } 
} 

和它的工作。网址http://localhost:8080/whatever/rest/entity可达