feat: change api url

This commit is contained in:
hanif salafi 2026-04-10 11:39:36 +07:00
parent 1489408b40
commit 1a17ce15aa
4 changed files with 8 additions and 7 deletions

3
.env
View File

@ -1 +1,2 @@
MEDOLS_CLIENT_KEY=bb65b1ad-e954-4a1a-b4d0-74df5bb0b640
MEDOLS_CLIENT_KEY=bb65b1ad-e954-4a1a-b4d0-74df5bb0b640
NEXT_PUBLIC_API_URL=http://localhost:8800

View File

@ -0,0 +1,2 @@
/** Qudo backend API base URL (set in `.env` as `NEXT_PUBLIC_API_URL`, e.g. `https://qudo.id/api` or `http://localhost:8800`). */
export const API_BASE_URL = process.env.NEXT_PUBLIC_API_URL ?? "";

View File

@ -1,9 +1,8 @@
import axios from "axios";
const baseURL = "https://qudo.id/api";
import { API_BASE_URL } from "./api-base-url";
const axiosBaseInstance = axios.create({
baseURL,
baseURL: API_BASE_URL,
headers: {
"Content-Type": "application/json",
"X-Client-Key": "9ca7f706-a8b0-4520-b467-5e8321df36fb",

View File

@ -1,13 +1,12 @@
import axios from "axios";
import { postSignIn } from "../master-user";
import Cookies from "js-cookie";
const baseURL = "https://qudo.id/api";
import { API_BASE_URL } from "./api-base-url";
const refreshToken = Cookies.get("refresh_token");
const axiosInterceptorInstance = axios.create({
baseURL,
baseURL: API_BASE_URL,
headers: {
"Content-Type": "application/json",
"X-Client-Key": "9ca7f706-a8b0-4520-b467-5e8321df36fb",