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
Raw Normal View History

2020-08-03 12:04:07 +02:00
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'
}
})
})()
2020-08-03 12:04:07 +02:00
export default api