Skip to content

Commit

Permalink
reusing the VITE_BACKEND_URL for the api calls
Browse files Browse the repository at this point in the history
  • Loading branch information
jazzgrewal committed May 23, 2024
1 parent 1147b72 commit 6ee5569
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 4 deletions.
2 changes: 1 addition & 1 deletion frontend/Caddyfile
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@
}
handle /env.js {
header Content-Type "text/javascript"
respond `window.config = {"VITE_USER_POOLS_WEB_CLIENT_ID":"{$VITE_USER_POOLS_WEB_CLIENT_ID}","VITE_ZONE":"{$VITE_ZONE}","VITE_BACKEND_URL":"{$VITE_BACKEND_URL}","BACKEND_URL":"{$BACKEND_URL}"};`
respond `window.config = {"VITE_USER_POOLS_WEB_CLIENT_ID":"{$VITE_USER_POOLS_WEB_CLIENT_ID}","VITE_ZONE":"{$VITE_ZONE}","VITE_BACKEND_URL":"{$VITE_BACKEND_URL}"};`
}

handle_path /* {
Expand Down
2 changes: 0 additions & 2 deletions frontend/openshift.deploy.yml
Original file line number Diff line number Diff line change
Expand Up @@ -96,8 +96,6 @@ objects:
imagePullPolicy: Always
name: ${NAME}
env:
- name: BACKEND_URL
value: "https://${NAME}-${ZONE}-backend.${DOMAIN}"
- name: LOG_LEVEL
value: "${LOG_LEVEL}"
- name: VITE_BACKEND_URL
Expand Down
3 changes: 2 additions & 1 deletion frontend/src/services/OpeningService.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
import axios from 'axios';
import { getAuthIdToken } from './AuthService';
import { env } from '../env';

const backendUrl = process.env.BACKEND_URL;
const backendUrl = env.VITE_BACKEND_URL;

export async function fetchRecentOpenings() {
let authToken = getAuthIdToken();
Expand Down

0 comments on commit 6ee5569

Please sign in to comment.