File tree Expand file tree Collapse file tree 3 files changed +6
-3
lines changed
Expand file tree Collapse file tree 3 files changed +6
-3
lines changed Original file line number Diff line number Diff line change 1313 "CHANNEL_ACCESS_TOKEN" : " CsR1tRMsaaMgQYEoi1J50Wi7W/EQyNUF8pZpdBlaIJu3PMEGCoiP62NAFcb4++fimhkXfWqAN2EV9mYy77No0JTSvTjS3Umyw8Z+4Bun85HWW8zfQ25YI93LKSHfWee0CE13U0nBh0Vv2sBNVKboDgdB04t89/1O/w1cDnyilFU=" ,
1414 "CHANNEL_SECRET" : " 58a42475f74073df54edda24cde00f50" ,
1515 "PORT" : " 8089" ,
16+ "POSTGRES_HOST" : " localhost" ,
1617 },
1718 }
1819 ]
Original file line number Diff line number Diff line change @@ -120,7 +120,7 @@ module.exports = {
120120 if ( pair . indexOf ( '_' + currency ) === - 1 ) {
121121 continue ;
122122 }
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 ) ;
124124 if ( response == undefined ) {
125125 if ( withTimestamp == true ) {
126126 response = tickers [ pair ] . updatetime . toISOString ( ) + '\n' + price ;
Original file line number Diff line number Diff line change @@ -4,13 +4,15 @@ const initOptions = {
44} ;
55const pgp = require ( 'pg-promise' ) ( initOptions ) ;
66const 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' ,
810 port : 5432 ,
911 database : 'example_database' ,
1012 user : 'postgres' ,
1113 password : 'example'
1214} ;
13- const pgUri = 'postgres://postgres:example@postgres-db:5432/example_database' ;
15+ // const pgUri = 'postgres://postgres:example@postgres-db:5432/example_database';
1416
1517const db = pgp ( config ) ;
1618
You can’t perform that action at this time.
0 commit comments