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.
website/tools/api.ts

18 lines
363 B
TypeScript
Raw Permalink Normal View History

import axios from 'axios'
export const API_VERSION = '1.0.0'
export const API_DEFAULT_PORT = 8080
export const API_URL =
process.env.NEXT_PUBLIC_API_URL != null
? process.env.NEXT_PUBLIC_API_URL
: `http://localhost:${API_DEFAULT_PORT}`
export const api = axios.create({
baseURL: API_URL,
headers: {
'Content-Type': 'application/json'
}
})