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

Is it necessary to have such a flat collections structure? #153

Closed Hainesy closed 6 years ago

Hainesy commented 6 years ago

Our API urls will probably be more nested than what in-memory-web-api seems to allow. Is there any way to customise the url per collection? Or do we have to create separate feature modules to get around this?

nicwease commented 6 years ago

you might be able to do something like this by overriding the responseInterceptor() method. if you send a request to a particular URL that would not be returned by the service; then match that url and return the response you need from wherever.

wardbell commented 6 years ago

I understand the need to return complex objects from real web APIs. The problem is that simulating all possible APIs and their structures is beyond the intention of this library which is to support the Angular documentation samples. The responseInterceptor may be the way to go.

Closing because we have no intention of pursuing this idea (worthy as it might be) . If you come up with a way to do it and a PR, we'd certainly consider that.