So I am trying to intercept my axios call in other return a custom response. I checked the axios.interceptors but it seems they are not used the way I want to use it.
const axios = require('axios')
const url = 'https://jsonplaceholder.typicode.com/posts/';
const request = axios({
method: 'GET',
url,
});
// some middleware to intercept the request and return a custom response
request.then(customResponse => console.log(customResponse))