mirror of
https://github.com/fosrl/pangolin.git
synced 2025-08-14 06:39:08 +02:00
automatically set the base url
This commit is contained in:
parent
29777da430
commit
0838679120
4 changed files with 40 additions and 38 deletions
|
@ -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",
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue