File tree Expand file tree Collapse file tree 3 files changed +10
-4
lines changed
Expand file tree Collapse file tree 3 files changed +10
-4
lines changed Original file line number Diff line number Diff line change @@ -6,6 +6,10 @@ FRONT_END_URL="https://dvoting-dev.dedis.ch:3000"
66# Proxy address of the default proxy
77DELA_NODE_URL="http://localhost:9081"
88
9+ # Backend server
10+ BACKEND_HOST="localhost"
11+ BACKEND_PORT="5000"
12+
913# Secret used to create secure sessions
1014SESSION_SECRET="session secret"
1115
@@ -17,4 +21,6 @@ PRIVATE_KEY="28912721dfd507e198b31602fb67824856eb5a674c021d49fdccbe52f0234409"
1721DB_PATH="./"
1822# Database credentials
1923DATABASE_USERNAME = "dvoting"
20- DATABASE_PASSWORD = "dvoting"
24+ DATABASE_PASSWORD = "dvoting"
25+ DATABASE_PORT = 5432
26+ DATABASE_HOST = "localhost"
Original file line number Diff line number Diff line change @@ -48,8 +48,8 @@ let enf: Enforcer;
4848async function initEnf ( ) {
4949 const a = await SequelizeAdapter . newAdapter ( {
5050 dialect : 'postgres' ,
51- host : 'localhost' ,
52- port : 5432 ,
51+ host : process . env . DATABASE_HOST ,
52+ port : parseInt ( process . env . DATABASE_PORT || ' 5432' , 10 ) ,
5353 username : process . env . DATABASE_USERNAME ,
5454 password : process . env . DATABASE_PASSWORD ,
5555 database : 'casbin' ,
Original file line number Diff line number Diff line change @@ -3,7 +3,7 @@ const { createProxyMiddleware } = require('http-proxy-middleware');
33module . exports = function ( app ) {
44 app . use (
55 createProxyMiddleware ( '/api' , {
6- target : ' http://localhost:5000' ,
6+ target : ` http://${ process . env . BACKEND_HOST } : ${ process . env . BACKEND_PORT } ` ,
77 changeOrigin : true ,
88 headers : {
99 Connection : 'keep-alive' ,
You can’t perform that action at this time.
0 commit comments