mirror of
https://github.com/fosrl/pangolin.git
synced 2026-02-06 10:00:34 +00:00
automatically set the base url
This commit is contained in:
@@ -1,7 +1,9 @@
|
||||
import axios from "axios";
|
||||
|
||||
const baseURL = `${window.location.protocol}//${window.location.host}/api/v1`;
|
||||
|
||||
export const api = axios.create({
|
||||
baseURL: `http://${process.env.NEXT_PUBLIC_SITE_DOMAIN || "localhost:3000"}/api/v1`,
|
||||
baseURL,
|
||||
timeout: 10000,
|
||||
headers: {
|
||||
"Content-Type": "application/json",
|
||||
|
||||
Reference in New Issue
Block a user