mercredi 8 juillet 2015

preprocess request in pretender.js

there is a a library called pretender.js which allow to mock API, a great tool in general with one limitation: it can't deal with absolute urls. So, when requests are performed by 3rd party libraries and they use an absolute url, like http://localhost:4200/api/v1/s3_mock, there will be an following error Pretender will not respond to requests for URLs. It is not possible to accurately simluate the browser's CSP. Remove the http://localhost from http://localhost:4200/api/v1/s3_mock and try again

I wonder how it is possible to alter the request and make url relative inside pretender.

Aucun commentaire:

Enregistrer un commentaire