Advertisement
Shell_Casing

Untitled

Jul 30th, 2020
1,677
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. import { SET_LOADING } from "../store/actions/types";
  2. import axios from "axios";
  3.  
  4. export const config = {
  5.  
  6.     SERVER_URL: `http://localhost:5000/`,
  7.  
  8.     AUTH_URL: `http://localhost:4000/api/auth`,
  9.  
  10.     httpHeaders: { headers: { 'Content-Type': 'application/json' } },
  11.  
  12.     // global axios setup
  13.     setAuthHeaderToken: axios.interceptors.request.use(config => {
  14.         config.headers.authorization = `Bearer ${localStorage.getItem('sre')}`;
  15.         return config;
  16.     }, error => Promise.reject(error)),
  17.  
  18.     setLoading: () => ({ type: SET_LOADING }),
  19.  
  20. };
  21.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement