feat: change api url
This commit is contained in:
parent
1489408b40
commit
1a17ce15aa
3
.env
3
.env
|
|
@ -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
|
||||||
|
|
@ -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 ?? "";
|
||||||
|
|
@ -1,9 +1,8 @@
|
||||||
import axios from "axios";
|
import axios from "axios";
|
||||||
|
import { API_BASE_URL } from "./api-base-url";
|
||||||
const baseURL = "https://qudo.id/api";
|
|
||||||
|
|
||||||
const axiosBaseInstance = axios.create({
|
const axiosBaseInstance = axios.create({
|
||||||
baseURL,
|
baseURL: API_BASE_URL,
|
||||||
headers: {
|
headers: {
|
||||||
"Content-Type": "application/json",
|
"Content-Type": "application/json",
|
||||||
"X-Client-Key": "9ca7f706-a8b0-4520-b467-5e8321df36fb",
|
"X-Client-Key": "9ca7f706-a8b0-4520-b467-5e8321df36fb",
|
||||||
|
|
|
||||||
|
|
@ -1,13 +1,12 @@
|
||||||
import axios from "axios";
|
import axios from "axios";
|
||||||
import { postSignIn } from "../master-user";
|
import { postSignIn } from "../master-user";
|
||||||
import Cookies from "js-cookie";
|
import Cookies from "js-cookie";
|
||||||
|
import { API_BASE_URL } from "./api-base-url";
|
||||||
const baseURL = "https://qudo.id/api";
|
|
||||||
|
|
||||||
const refreshToken = Cookies.get("refresh_token");
|
const refreshToken = Cookies.get("refresh_token");
|
||||||
|
|
||||||
const axiosInterceptorInstance = axios.create({
|
const axiosInterceptorInstance = axios.create({
|
||||||
baseURL,
|
baseURL: API_BASE_URL,
|
||||||
headers: {
|
headers: {
|
||||||
"Content-Type": "application/json",
|
"Content-Type": "application/json",
|
||||||
"X-Client-Key": "9ca7f706-a8b0-4520-b467-5e8321df36fb",
|
"X-Client-Key": "9ca7f706-a8b0-4520-b467-5e8321df36fb",
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue