I would like to run a mock server e.g. JSON Server, and switch between my real Java REST API backend and this JSON Server during development (for instance when real backend services are down). Is there a way to easily configure angular to use a different host for all request?
My setup:
- localhost:8080 - Spring MVC application, serves SPA + API
- localhost:8080/api - Spring MVC Rest API
- localhost:9090/api - JSON Server
And I would like to switch between calls to localhost:8080/api
and localhost:9090/api
with one singe line for whole Angular application.