File tree 3 files changed +10
-4
lines changed
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"
6
6
# Proxy address of the default proxy
7
7
DELA_NODE_URL="http://localhost:9081"
8
8
9
+ # Backend server
10
+ BACKEND_HOST="localhost"
11
+ BACKEND_PORT="5000"
12
+
9
13
# Secret used to create secure sessions
10
14
SESSION_SECRET="session secret"
11
15
@@ -17,4 +21,6 @@ PRIVATE_KEY="28912721dfd507e198b31602fb67824856eb5a674c021d49fdccbe52f0234409"
17
21
DB_PATH="./"
18
22
# Database credentials
19
23
DATABASE_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;
48
48
async function initEnf ( ) {
49
49
const a = await SequelizeAdapter . newAdapter ( {
50
50
dialect : 'postgres' ,
51
- host : 'localhost' ,
52
- port : 5432 ,
51
+ host : process . env . DATABASE_HOST ,
52
+ port : parseInt ( process . env . DATABASE_PORT || ' 5432' , 10 ) ,
53
53
username : process . env . DATABASE_USERNAME ,
54
54
password : process . env . DATABASE_PASSWORD ,
55
55
database : 'casbin' ,
Original file line number Diff line number Diff line change @@ -3,7 +3,7 @@ const { createProxyMiddleware } = require('http-proxy-middleware');
3
3
module . exports = function ( app ) {
4
4
app . use (
5
5
createProxyMiddleware ( '/api' , {
6
- target : ' http://localhost:5000' ,
6
+ target : ` http://${ process . env . BACKEND_HOST } : ${ process . env . BACKEND_PORT } ` ,
7
7
changeOrigin : true ,
8
8
headers : {
9
9
Connection : 'keep-alive' ,
You can’t perform that action at this time.
0 commit comments