From 845418e5aab49956e8416992b59714f57d5fca85 Mon Sep 17 00:00:00 2001 From: Six <23470032+6ixfalls@users.noreply.github.com> Date: Wed, 17 Jan 2024 17:31:15 -0800 Subject: [PATCH] fix: Use baseUrl from env in AxiosProvider --- apps/client/pages/_app.tsx | 2 +- libs/client/shared/src/providers/AxiosProvider.tsx | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/apps/client/pages/_app.tsx b/apps/client/pages/_app.tsx index 8b8c1c4a..c4e9fddf 100644 --- a/apps/client/pages/_app.tsx +++ b/apps/client/pages/_app.tsx @@ -83,7 +83,7 @@ export default function App({ - + <> {Page.isPublic === true ? ( diff --git a/libs/client/shared/src/providers/AxiosProvider.tsx b/libs/client/shared/src/providers/AxiosProvider.tsx index 38aa8d50..f292dd4c 100644 --- a/libs/client/shared/src/providers/AxiosProvider.tsx +++ b/libs/client/shared/src/providers/AxiosProvider.tsx @@ -67,8 +67,8 @@ function createInstance(options?: CreateInstanceOptions) { return instance } -export function AxiosProvider({ children }: PropsWithChildren) { - const API_URL = process.env.NEXT_PUBLIC_API_URL || 'http://localhost:3333' +export function AxiosProvider({ children, baseUrl }: PropsWithChildren<{baseUrl: string?}>) { + const API_URL = baseUrl || 'http://localhost:3333' // Expose a default instance with auth, superjson, headers const defaultInstance = useMemo(() => {