frisbee-intercept
Create Interceptors for your frisbee APIs so you can add headers to requests and pre-process the server reponses.
Getting Started
Prerequisites
As its name implies, frisbee should be installed to intercept its requests. Follow the Installation steps in their repository.
Installing
npm install --save frisbee-intercept
Usage
; // create a new instance of Frisbee const myAPI = baseURI: "http://myBaseURI.com.eg/" headers: 'Accept': 'application/json' 'Content-Type': 'application/json' ; //Create an intereption wrapper arround your APIvar myAPIInterceptor = ; //register your interceptor with your API, ** you can register as many interceptors as you want to your api **const unregister = myAPIInterceptor; //make your requests to see interception in actionmyAPI; // Unregister your interceptor;
Credits
- This code was taken from fetch-intercept and adapted to work with frisbee APIs
- This library was developed at Codelabsys