From 4f9dc49bea554b6ef3699a04d7ae499817144f27 Mon Sep 17 00:00:00 2001 From: ludchieng Date: Wed, 23 Nov 2022 18:53:59 +0100 Subject: [PATCH] [env] Add api url var --- .gitignore | 1 + src/App.vue | 2 +- src/utils/fetcher.ts | 2 +- 3 files changed, 3 insertions(+), 2 deletions(-) diff --git a/.gitignore b/.gitignore index 403adbc..0035d70 100644 --- a/.gitignore +++ b/.gitignore @@ -4,6 +4,7 @@ node_modules # local env files +.env .env.local .env.*.local diff --git a/src/App.vue b/src/App.vue index 9ef937a..237ee24 100644 --- a/src/App.vue +++ b/src/App.vue @@ -27,7 +27,7 @@ export default Vue.extend({ }) } // Ping server to wake it up - fetch('https://idfm-prim.herokuapp.com/') + fetch(process.env.VUE_APP_API_URL) }, watch: { '$route.params.tab': { diff --git a/src/utils/fetcher.ts b/src/utils/fetcher.ts index 52f58d7..9d24d3c 100644 --- a/src/utils/fetcher.ts +++ b/src/utils/fetcher.ts @@ -34,7 +34,7 @@ export const fetchTimetables = async ( return new Promise((resolve) => { for (const mref of mrefs) { // TODO Cancel fetch on stop change - fetch(`https://idfm-prim.herokuapp.com/stop-monitoring?MonitoringRef=STIF:StopPoint:Q:${mref}:`, { + fetch(`${process.env.VUE_APP_API_URL}/stop-monitoring?MonitoringRef=STIF:StopPoint:Q:${mref}:`, { ...(abortSignal && { signal: abortSignal }), }) .then(res => {