File tree Expand file tree Collapse file tree 3 files changed +24
-16
lines changed Expand file tree Collapse file tree 3 files changed +24
-16
lines changed Original file line number Diff line number Diff line change 1
1
import nconf from 'nconf' ;
2
2
import defaults from './defaults' ;
3
3
4
- nconf
5
- . argv ( {
6
- separator : '__' ,
7
- parseValues : true ,
8
- } )
9
- . env ( {
10
- separator : '__' ,
11
- lowerCase : true ,
12
- parseValues : true ,
13
- } ) ;
4
+ const get = ( ) => {
5
+ nconf . reset ( ) ;
14
6
15
- nconf . defaults ( defaults ) ;
7
+ nconf
8
+ . argv ( {
9
+ separator : '__' ,
10
+ parseValues : true ,
11
+ } )
12
+ . env ( {
13
+ separator : '__' ,
14
+ lowerCase : true ,
15
+ parseValues : true ,
16
+ } ) ;
17
+ nconf . defaults ( defaults ) ;
16
18
17
- export default nconf ;
19
+ return nconf . get ( ) ;
20
+ } ;
21
+
22
+ export default get ;
Original file line number Diff line number Diff line change @@ -12,9 +12,11 @@ const handle = (signal) => {
12
12
process . on ( 'SIGINT' , handle ) ;
13
13
process . on ( 'SIGTERM' , handle ) ;
14
14
15
+ const parsedConfig = config . get ( ) ;
16
+
15
17
socketServer ( {
16
- baseUrl : config . get ( ' base_url' ) ,
17
- staticPath : config . get ( ' static_path' ) ,
18
- port : config . get ( ' port' ) ,
19
- pingInterval : config . get ( ' ping_interval' ) ,
18
+ baseUrl : parsedConfig . base_url ,
19
+ staticPath : parsedConfig . static_path ,
20
+ port : parsedConfig . port ,
21
+ pingInterval : parsedConfig . ping_interval ,
20
22
} ) ;
Original file line number Diff line number Diff line change
1
+ export { default as getConfig } from './config' ;
1
2
export { default as defaultConfig } from './config/defaults' ;
2
3
export { default as socketServer } from './socketserver' ;
You can’t perform that action at this time.
0 commit comments