mardi 19 juin 2018

Rest Adapter set dynamic host and headers depending on route

I have an existing ember application whose APIs are being updated and shifted on different server. So, currently some routes need old API and some need new API. I don't want to create separate adapters for these routes. I want to manage both new and old APIs with application.js adapter and serializer.

On serializer end, i have made a transformer mixin which is fine. But on adapter (adapters/application.js) i cannot set host and headers dynamically based on route. For pathForType i have used a method in mixin which returns new/old API path based o route name. Cannot set header and host this way.

Can someone suggest a way to handle this ??




Aucun commentaire:

Enregistrer un commentaire