Angular CLI: Change REST API URL on build

后端 未结 7 1657
心在旅途
心在旅途 2021-02-02 08:58

I want to remove my local server prefix from my REST API URLs (example, http://localhost:8080) when building for production (ng build --prod).

I get that i

7条回答
  •  清酒与你
    2021-02-02 09:42

    Hardcoding in this or another way an address to the API server is not a good way. The API URL should be stored in a configuration file possible to change without recompiling whole application. I think this is a way you should do it: Editable config file

提交回复
热议问题