import axios from "axios";

const http = axios.create({
	baseURL: process.env.REACT_APP_BACKEND_URL,
});
http.interceptors.request.use((config) => {
	const authToken = localStorage.getItem("authToken");
	if (authToken) {
		config.headers.Authorization = `Bearer ${authToken}`;
	}

	return config;
});

export default http;
