File tree 3 files changed +6
-3
lines changed
3 files changed +6
-3
lines changed Original file line number Diff line number Diff line change 13
13
"CHANNEL_ACCESS_TOKEN" : " CsR1tRMsaaMgQYEoi1J50Wi7W/EQyNUF8pZpdBlaIJu3PMEGCoiP62NAFcb4++fimhkXfWqAN2EV9mYy77No0JTSvTjS3Umyw8Z+4Bun85HWW8zfQ25YI93LKSHfWee0CE13U0nBh0Vv2sBNVKboDgdB04t89/1O/w1cDnyilFU=" ,
14
14
"CHANNEL_SECRET" : " 58a42475f74073df54edda24cde00f50" ,
15
15
"PORT" : " 8089" ,
16
+ "POSTGRES_HOST" : " localhost" ,
16
17
},
17
18
}
18
19
]
Original file line number Diff line number Diff line change @@ -120,7 +120,7 @@ module.exports = {
120
120
if ( pair . indexOf ( '_' + currency ) === - 1 ) {
121
121
continue ;
122
122
}
123
- var price = currency . toUpperCase ( ) + '->' + pair . replace ( currency , '' ) . toUpperCase ( ) + ': ' + ( Math . round ( tickers [ pair ] . last * 10000 ) / 10000 ) ;
123
+ var price = currency . toUpperCase ( ) + '->' + pair . replace ( '_' + currency , '' ) . toUpperCase ( ) + ': ' + ( Math . round ( tickers [ pair ] . last * 10000 ) / 10000 ) ;
124
124
if ( response == undefined ) {
125
125
if ( withTimestamp == true ) {
126
126
response = tickers [ pair ] . updatetime . toISOString ( ) + '\n' + price ;
Original file line number Diff line number Diff line change @@ -4,13 +4,15 @@ const initOptions = {
4
4
} ;
5
5
const pgp = require ( 'pg-promise' ) ( initOptions ) ;
6
6
const config = {
7
- host : 'postgres-db' ,
7
+ // In production environment, host name is postgres container name from docker run or yml file
8
+ // In developer environment, host name needs to defined in env variables or launch.json
9
+ host : process . env . POSTGRES_HOST || 'postgres-db' ,
8
10
port : 5432 ,
9
11
database : 'example_database' ,
10
12
user : 'postgres' ,
11
13
password : 'example'
12
14
} ;
13
- const pgUri = 'postgres://postgres:example@postgres-db:5432/example_database' ;
15
+ // const pgUri = 'postgres://postgres:example@postgres-db:5432/example_database';
14
16
15
17
const db = pgp ( config ) ;
16
18
You can’t perform that action at this time.
0 commit comments