From 51bc44bec37a734acb7387ada34996d8f80ea24c Mon Sep 17 00:00:00 2001 From: jorgep Date: Tue, 9 Jan 2024 09:11:46 +0100 Subject: [PATCH] refactor: refs #6656 set proxy for test environment --- .env.example | 3 ++- Dockerfile | 2 ++ proxy.js | 2 +- 3 files changed, 5 insertions(+), 2 deletions(-) diff --git a/.env.example b/.env.example index 3e0d362..8f6bf2e 100644 --- a/.env.example +++ b/.env.example @@ -1 +1,2 @@ -TARGET='url del servidor local' \ No newline at end of file +TARGET='url del servidor local' +PORT='puerto de acceso' \ No newline at end of file diff --git a/Dockerfile b/Dockerfile index 073fe63..4f8c079 100644 --- a/Dockerfile +++ b/Dockerfile @@ -30,3 +30,5 @@ COPY \ index.html \ clockIn.html \ ./ + +CMD ["node", "proxy.js"] \ No newline at end of file diff --git a/proxy.js b/proxy.js index 3d3085b..30f546f 100644 --- a/proxy.js +++ b/proxy.js @@ -12,7 +12,7 @@ const apiProxy = createProxyMiddleware('/api', { app.use('/api', apiProxy); app.use('/', express.static(__dirname)); -const port = 4000; +const port = process.env.PORT; app.listen(port, () => { console.log(`Server running on port: ${port}`); });