import axios from "axios"

const api = axios.create({
  baseURL: "http://localhost:5000/api/admin"
})

api.interceptors.request.use(config => {
  const token = localStorage.getItem("adminToken")

  console.log("TOKEN:", token);

  if (token) {
    config.headers.Authorization = `Bearer ${token}`
  }

  return config
})

export default api