Advertisement
Guest User

Untitled

a guest
Mar 21st, 2018
58
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.47 KB | None | 0 0
  1. export default function Connection(token, baseURL, headers = null) {
  2. currentConnection = axios.create({
  3. baseURL: baseURL,
  4. timeout: 12000,
  5. headers: {
  6. 'Accept': 'application/json',
  7. 'X-Access-Token': currentToken
  8. }
  9. });
  10.  
  11. currentConnection.interceptors.response.use((response) => {
  12. return response;
  13. }, (error) => {
  14. // Only send the response
  15. return Promise.reject(error.response);
  16. });
  17.  
  18. return currentConnection;
  19. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement