2023-10-23 23:33:39 +02:00
|
|
|
import axios from "axios"
|
2021-10-24 06:09:43 +02:00
|
|
|
|
2023-12-28 05:10:51 +01:00
|
|
|
export const API_VERSION = "1.2.10"
|
2021-10-24 06:09:43 +02:00
|
|
|
|
2022-01-01 20:42:25 +01:00
|
|
|
export const API_DEFAULT_PORT = 8080
|
|
|
|
|
2021-10-24 06:09:43 +02:00
|
|
|
export const API_URL =
|
2023-10-23 23:33:39 +02:00
|
|
|
process.env["NEXT_PUBLIC_API_URL"] != null
|
|
|
|
? process.env["NEXT_PUBLIC_API_URL"]
|
2022-12-13 11:38:07 +01:00
|
|
|
: `http://127.0.0.1:${API_DEFAULT_PORT}`
|
2021-10-24 06:09:43 +02:00
|
|
|
|
|
|
|
export const api = axios.create({
|
|
|
|
baseURL: API_URL,
|
|
|
|
headers: {
|
2023-10-23 23:33:39 +02:00
|
|
|
"Content-Type": "application/json",
|
|
|
|
},
|
2021-10-24 06:09:43 +02:00
|
|
|
})
|