From 759e4c3711419eb9e241bea5d062354e7cf5ab13 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Nick=20=27MorpheusXAUT=27=20M=C3=BCller?= Date: Sat, 25 Mar 2023 17:18:29 +0100 Subject: [PATCH] Make base API path configurable via env variable --- backend/src/app.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/backend/src/app.ts b/backend/src/app.ts index 7675c3e..7f1c251 100644 --- a/backend/src/app.ts +++ b/backend/src/app.ts @@ -4,14 +4,14 @@ import morgan from 'morgan'; import router from './router'; import wxService from './services/wx.service'; -const { PORT = 3000 } = process.env; +const { PORT = 3000, BASE_PATH = '/api' } = process.env; const app = express(); app.set('trust proxy', true); app.use(morgan('combined')); -app.use('/api', router.router); +app.use(BASE_PATH, router.router); const frontendRoot = '/opt/frontend/dist'; app.use(express.static(frontendRoot));