Skip to content

Commit

Permalink
Fix frontend url issues (#49)
Browse files Browse the repository at this point in the history
* Fix api route env

* Added url in dockerfile

* Add test logs

* Clean up test logs
  • Loading branch information
MichaelZhao21 authored Oct 7, 2023
1 parent c7fb83e commit 55a3628
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 4 deletions.
4 changes: 4 additions & 0 deletions .do/deploy.template.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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
Expand Down
1 change: 1 addition & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
8 changes: 4 additions & 4 deletions client/src/api.ts
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ export async function getRequest<T>(path: string, auth: string): Promise<FetchRe
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 };
Expand All @@ -39,7 +39,7 @@ export async function postRequest<T>(
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 };
Expand All @@ -61,7 +61,7 @@ export async function putRequest<T>(
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 };
Expand All @@ -80,7 +80,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 };
Expand Down

0 comments on commit 55a3628

Please sign in to comment.