{"size": 346, "ext": "js", "max_stars_repo_path": "src/web/restaurant-management/src/axios-interceptors.js", "max_stars_repo_name": "paulrozhkin/a08-otus-tamagotchi", "max_stars_repo_stars_event_min_datetime": null, "max_stars_repo_stars_event_max_datetime": null, "max_issues_repo_path": "src/web/restaurant-management/src/axios-interceptors.js", "max_issues_repo_name": "paulrozhkin/a08-otus-tamagotchi", "max_issues_repo_issues_event_min_datetime": null, "max_issues_repo_issues_event_max_datetime": null, "max_forks_repo_path": "src/web/restaurant-management/src/axios-interceptors.js", "max_forks_repo_name": "paulrozhkin/a08-otus-tamagotchi", "max_forks_repo_forks_event_min_datetime": null, "max_forks_repo_forks_event_max_datetime": null}
{"max_stars_count": null, "max_issues_count": null, "max_forks_count": null, "avg_line_length": 24.7142857143, "max_line_length": 65, "alphanum_fraction": 0.7312138728}
import axios from "axios";
import store from "./store";
const {REACT_APP_API_URL} = process.env;

axios.defaults.baseURL = REACT_APP_API_URL;

axios.interceptors.request.use(function (config) {
  const token = store.getState().jwt.token
  config.headers.Authorization =  token ? `Bearer ${token}` : '';
  return config;
});

export default axios
