From 8d4c9afcfa2eaf1260b5f6c853fd845d30d9219a Mon Sep 17 00:00:00 2001 From: Oscar Eriksson Date: Sun, 23 Jun 2024 21:42:12 +0200 Subject: [PATCH 1/2] Add env to set frontend url --- backend/src/routes/index.ts | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/backend/src/routes/index.ts b/backend/src/routes/index.ts index 1c579c3..9e9df2c 100644 --- a/backend/src/routes/index.ts +++ b/backend/src/routes/index.ts @@ -39,5 +39,6 @@ const setupGraphql = (app: express.Application, tools: Tools) => { export const setupRoutes = (app: express.Application, tools: Tools) => { setupGraphql(app, tools); - app.use("/", proxy("http://localhost:3001")); + const frontend_url = process.env.FRONTEND_URL || "http://localhost:3001"; + app.use("/", proxy(frontend_url)); }; From 81c86d854ebc28f9d77d39fcc864d2231fca6c0d Mon Sep 17 00:00:00 2001 From: Oscar Eriksson Date: Sun, 23 Jun 2024 21:44:08 +0200 Subject: [PATCH 2/2] Add example --- backend/.env.example | 2 ++ 1 file changed, 2 insertions(+) diff --git a/backend/.env.example b/backend/.env.example index 4da92c7..9a90760 100644 --- a/backend/.env.example +++ b/backend/.env.example @@ -13,6 +13,8 @@ CLIENT_SECRET=[client secret] API_KEY=[api-key id]:[api-key] # pre-shared token SECRET=some_random_long_string +FRONTEND_URL=http://localhost:3001 # URL to the frontend used for proxying + REDIS_HOST=localhost REDIS_PORT=6379 REDIS_PASS=""