refs #6274 dotenv added
gitea/worker-time-control/pipeline/head This commit looks good Details

This commit is contained in:
Jorge Penadés 2023-12-07 15:23:02 +01:00
parent 8b68af8a9c
commit c62771b6c7
5 changed files with 19 additions and 3 deletions

1
.env.example Normal file
View File

@ -0,0 +1 @@
TARGET='url del servidor local'

3
.gitignore vendored
View File

@ -1 +1,2 @@
node_modules
node_modules
.env

12
package-lock.json generated
View File

@ -9,6 +9,7 @@
"version": "1.0.2",
"license": "GPL-3.0",
"dependencies": {
"dotenv": "^16.3.1",
"fastclick": "^1.0.6",
"jquery": "^3.7.0"
},
@ -195,6 +196,17 @@
"npm": "1.2.8000 || >= 1.4.16"
}
},
"node_modules/dotenv": {
"version": "16.3.1",
"resolved": "https://registry.npmjs.org/dotenv/-/dotenv-16.3.1.tgz",
"integrity": "sha512-IPzF4w4/Rd94bA9imS68tZBaYyBWSCE47V1RGuMrB94iyTOIEwRmVL2x/4An+6mETpLrKJ5hQkB8W4kFAadeIQ==",
"engines": {
"node": ">=12"
},
"funding": {
"url": "https://github.com/motdotla/dotenv?sponsor=1"
}
},
"node_modules/ee-first": {
"version": "1.1.1",
"resolved": "https://registry.npmjs.org/ee-first/-/ee-first-1.1.1.tgz",

View File

@ -16,6 +16,7 @@
"npm": ">=8"
},
"dependencies": {
"dotenv": "^16.3.1",
"fastclick": "^1.0.6",
"jquery": "^3.7.0"
},

View File

@ -1,10 +1,11 @@
const express = require('express');
const dotenv = require('dotenv');
const { createProxyMiddleware } = require('http-proxy-middleware');
const app = express();
dotenv.config();
const apiProxy = createProxyMiddleware('/api', {
target: 'http://localhost:3000',
target: process.env.TARGET,
changeOrigin: true,
});