From c135a90413d2816b3c79fbda6aa4403720ee5648 Mon Sep 17 00:00:00 2001 From: Michael Zhao Date: Sat, 7 Oct 2023 15:31:48 -0500 Subject: [PATCH 1/4] Fix api route env --- .do/deploy.template.yaml | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/.do/deploy.template.yaml b/.do/deploy.template.yaml index ba5bc14..8ae67b6 100644 --- a/.do/deploy.template.yaml +++ b/.do/deploy.template.yaml @@ -6,6 +6,9 @@ spec: envs: - key: REACT_APP_JURY_NAME scope: RUN_AND_BUILD_TIME + - key: REACT_APP_JURY_URL + scope: RUN_AND_BUILD_TIME + value: /api - key: JURY_ADMIN_PASSWORD scope: RUN_AND_BUILD_TIME - key: MONGODB_URI @@ -14,6 +17,7 @@ spec: scope: RUN_AND_BUILD_TIME - key: EMAIL_PORT scope: RUN_AND_BUILD_TIME + value: "587" - key: EMAIL_FROM scope: RUN_AND_BUILD_TIME - key: EMAIL_PASSWORD From 0524663b1f49cce6856d3e12e0bb3c8d27e20d92 Mon Sep 17 00:00:00 2001 From: Michael Zhao Date: Sat, 7 Oct 2023 15:36:45 -0500 Subject: [PATCH 2/4] Added url in dockerfile --- Dockerfile | 1 + 1 file changed, 1 insertion(+) diff --git a/Dockerfile b/Dockerfile index 57e06aa..6a3a1b4 100644 --- a/Dockerfile +++ b/Dockerfile @@ -8,6 +8,7 @@ COPY ["client/package.json", "client/tailwind.config.js", "client/tsconfig.json" ARG NODE_ENV=production ARG REACT_APP_JURY_NAME ARG REACT_APP_HUB +ARG REACT_APP_JURY_URL RUN yarn install RUN yarn build From c91e3a2013e91fff6348a71a71c26c9f1bc1f11c Mon Sep 17 00:00:00 2001 From: Michael Zhao Date: Sat, 7 Oct 2023 15:52:43 -0500 Subject: [PATCH 3/4] Add test logs --- client/src/api.ts | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/client/src/api.ts b/client/src/api.ts index f542f8a..6f4cc1f 100644 --- a/client/src/api.ts +++ b/client/src/api.ts @@ -17,7 +17,7 @@ export async function getRequest(path: string, auth: string): Promise( // eslint-disable-next-line body: any ): Promise> { + console.log(BACKEND_URL); + console.log(process.env.REACT_APP_JURY_URL) try { const options: RequestInit = { method: 'POST', @@ -39,7 +41,7 @@ export async function postRequest( const response = await fetch(`${BACKEND_URL}${path}`, options); const data = await response.json(); return { status: response.status, error: data.error ? data.error : '', data }; - // eslint-disable-next-line + // eslint-disable-next-line } catch (error: any) { console.error(error); return { status: 404, error: error, data: null }; @@ -61,7 +63,7 @@ export async function putRequest( const response = await fetch(`${BACKEND_URL}${path}`, options); const data = await response.json(); return { status: response.status, error: data.error ? data.error : '', data }; - // eslint-disable-next-line + // eslint-disable-next-line } catch (error: any) { console.error(error); return { status: 404, error: error, data: null }; @@ -80,7 +82,7 @@ export async function deleteRequest( const response = await fetch(`${BACKEND_URL}${path}`, options); const data = await response.json(); return { status: response.status, error: data.error ? data.error : '', data }; - // eslint-disable-next-line + // eslint-disable-next-line } catch (error: any) { console.error(error); return { status: 404, error: error, data: null }; From 5aafa865c02696b0f20e254bea4cefb4622a7483 Mon Sep 17 00:00:00 2001 From: Michael Zhao Date: Sat, 7 Oct 2023 16:58:36 -0500 Subject: [PATCH 4/4] Clean up test logs --- client/src/api.ts | 2 -- 1 file changed, 2 deletions(-) diff --git a/client/src/api.ts b/client/src/api.ts index 6f4cc1f..2979767 100644 --- a/client/src/api.ts +++ b/client/src/api.ts @@ -30,8 +30,6 @@ export async function postRequest( // eslint-disable-next-line body: any ): Promise> { - console.log(BACKEND_URL); - console.log(process.env.REACT_APP_JURY_URL) try { const options: RequestInit = { method: 'POST',