admin管理员组

文章数量:1122826

I'm trying to set up a proxy in my Angular project to route specific API calls to a backend server. Here's the command I'm using to run the Angular application:

ng serve --proxy-config proxy.conf.json  

Below is the content of my proxy.conf.json file:

{  
  "/manifest.webmanifest": {  
    "target": "http://localhost:3090",  
    "secure": false  
  }  
}  

I expected requests to /manifest.webmanifest to be proxied to http://localhost:3090, but it doesn't seem to be working. When I make the request, the application still tries to fetch the resource from the default location instead of the proxy target.

  1. Verified that proxy.conf.json is in the root directory of the project.
  2. Confirmed that the backend server on http://localhost:3090 is running and reachable.
  3. Tried clearing browser cache and restarting the Angular server.

I’m not sure if I’m missing something in the configuration or setup.

Additional Information:

  • Angular CLI version: [Your Angular CLI version]
  • Node.js version: [Your Node.js version]

Any help or guidance would be greatly appreciated!

本文标签: angularjsUnable to Add Proxy in Angular CLI for Custom ConfigurationStack Overflow