This repository has been archived on 2024-10-29. You can view files and clone it, but cannot push or open issues or pull requests.
FunctionProject/website/utils/api.js

17 lines
327 B
JavaScript

import axios from 'axios'
export const API_URL = process.env.NEXT_PUBLIC_API_URL
const api = (() => {
const baseURL =
typeof window === 'undefined' ? process.env.CONTAINER_API_URL : API_URL
return axios.create({
baseURL,
headers: {
'Content-Type': 'application/json'
}
})
})()
export default api