0

Im having a problem with the urls on my build I have an angular and nest project, serving locally, works fine. I can fetch data from the server without problems. But when I run the angular build, the API url is wrong (http://localhost/api/todos) my API in this case is in localhost:3333. I tried to replace the proxy with this in the angular.json

{
"replace": "apps/front/proxy.conf.json",
 with": "apps/front/proxy-prod.conf.json"
 } 

I need to have the url to the api endpoint on the server (http://myServer/API), maybe Im missing something in the configuration

  • does proxy.prod.json file exist? by default this configuration comes only in the "serve" target, if you want it in the build you need to configure it. however, it is not recommended, this is only for development, in production the server must have CORS configured – Gui Seek Dec 03 '21 at 00:57

1 Answers1

0

does proxy.prod.json file exist? by default this configuration comes only in the "serve" target, if you want it in the build you need to configure it. however, it is not recommended, this is only for development, in production the server must have CORS configured

Gui Seek
  • 421
  • 4
  • 5