angular / in-memory-web-api

The code for this project has moved to the angular/angular repo. This repo is now archived.
MIT License
1.18k stars 232 forks source link

How to add multiple EndPoints with multiple API bases #201

Closed csaicharan closed 6 years ago

csaicharan commented 6 years ago

Suppose I have multiple end points like

1) 'api-base1/service1', 2) 'api-base2/service2'

How would i configure separate services for different api bases.

heyayush commented 6 years ago

multiple endpoints can be added like this

csaicharan commented 6 years ago

Thanks for the quick response, but i am looking for multiple API bases. Sorry for the wrong title.

If we consider the example 'api/heroes' and 'api/symbols' are two end points with the same base 'api/' but i am looking for with the different bases like 'api/v1/heros' and other 'api/v2/symbols'.

ghost commented 6 years ago

In my apps, I put the bases url in a environnement file. "base1": "....", "base2": "..."

In dev mode, base1 & 2 will use the same "mocked" base: /api in prod mode, base1 & 2 will use different values.

csaicharan commented 6 years ago

Thanks, it solves my requirement for some extend.