From 90b48e710fc84af8138b5cbb0f8e94c6454e919a Mon Sep 17 00:00:00 2001 From: Kilton937342 Date: Thu, 23 Feb 2023 17:33:47 +0100 Subject: [PATCH] env --- frontend/src/apis/auth.api.ts | 4 +++- frontend/src/apis/exo.api.ts | 4 ++-- frontend/src/apis/room.api.ts | 3 ++- 3 files changed, 7 insertions(+), 4 deletions(-) diff --git a/frontend/src/apis/auth.api.ts b/frontend/src/apis/auth.api.ts index 327cdac..f34ee0e 100644 --- a/frontend/src/apis/auth.api.ts +++ b/frontend/src/apis/auth.api.ts @@ -1,7 +1,9 @@ import axios from 'axios'; import { autoRefresh } from '../utils/utils'; +import {env} from '$env/dynamic/private'; + export const authInstance = axios.create({ - baseURL: `${process.env.API_BASE}`, + baseURL: `${env.API_BASE}`, headers: { 'Content-Type': 'application/json', Accept: 'application/json', diff --git a/frontend/src/apis/exo.api.ts b/frontend/src/apis/exo.api.ts index 08b36d3..0833c80 100644 --- a/frontend/src/apis/exo.api.ts +++ b/frontend/src/apis/exo.api.ts @@ -1,10 +1,10 @@ import axios from 'axios'; import { parse, stringify } from 'qs' import { autoRefresh } from '../utils/utils'; - +import {env} from '$env/dynamic/private'; export const exoInstance = axios.create({ paramsSerializer:{encode:(params)=> {return parse(params, {arrayFormat:"brackets"})}, serialize: (p)=>{return stringify(p, {arrayFormat: "repeat"})}}, - baseURL: `${process.env.API_BASE}`, + baseURL: `${env.API_BASE}`, headers: { 'Content-Type': 'application/json', Accept: 'application/json', diff --git a/frontend/src/apis/room.api.ts b/frontend/src/apis/room.api.ts index 4004953..5a344b5 100644 --- a/frontend/src/apis/room.api.ts +++ b/frontend/src/apis/room.api.ts @@ -1,8 +1,9 @@ import axios from 'axios'; import { autoRefresh } from '../utils/utils'; +import {env} from '$env/dynamic/private'; export const roomInstance = axios.create({ - baseURL: `${process.env.API_BASE}/room`, + baseURL: `${env.API_BASE}/room`, headers: { 'Content-Type': 'application/json', Accept: 'application/json',