0

I tried to add the proxy and Rewrite the URL path according to the angular documentation guidelines, but without success, the docs I have followed here: https://angular.io/guide/build#rewrite-the-url-path . What is the correct way to add angualr proxy in an angular multiproject, with angular 17?

1 Answer 1

0

Try these few steps to add proxy configuration for angular in a multi-project setup

  1. in your root project, create a file called - `proxy.config.json
  2. Add the proxy configuration in the file:
{
 "/api": {
   "target": "http:locahost:3000",
   "secure": false
  }
}

This way proxy API request to http:locahost:3000

  1. Now in the angular.json file, under the each project, add the proxyConfig settings like
"architect":{
 "serve": {
   "options": {
     "proxyConfig": "proxy.config.json"
  }
 }
}

I hope this will help you. Cheers 🥂

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.