kontenhumas-fe/service/http-config/axios-base-instance.ts

16 lines
435 B
TypeScript

import axios from "axios";
// Use environment variable for API URL, default to localhost:8080 for local development
const baseURL = process.env.NEXT_PUBLIC_API_URL || "https://kontenhumas.com/api/";
const axiosBaseInstance = axios.create({
baseURL,
headers: {
"content-type": "application/json",
"X-Client-Key": "b1ce6602-07ad-46c2-85eb-0cd6decfefa3",
},
withCredentials: true,
});
export default axiosBaseInstance;