File tree Expand file tree Collapse file tree 1 file changed +10
-5
lines changed Expand file tree Collapse file tree 1 file changed +10
-5
lines changed Original file line number Diff line number Diff line change @@ -36,10 +36,15 @@ class API {
3636 } ;
3737
3838 const { logger } = this . config ;
39- const storeIPAddress = new StoreIPAddress ( {
40- logger,
41- ...this . config . storeIPAddress
42- } ) ;
39+
40+ let storeIPAddress = false ;
41+
42+ if ( this . config . storeIPAddress )
43+ storeIPAddress = new StoreIPAddress ( {
44+ logger,
45+ ...this . config . storeIPAddress
46+ } ) ;
47+
4348 const cabin = new Cabin ( {
4449 logger,
4550 ...this . config . cabin
@@ -143,7 +148,7 @@ class API {
143148 }
144149
145150 // store the user's last ip address in the background
146- app . use ( storeIPAddress . middleware ) ;
151+ if ( storeIPAddress ) app . use ( storeIPAddress . middleware ) ;
147152
148153 // allow before hooks to get setup
149154 if ( _ . isFunction ( this . config . hookBeforeRoutes ) )
You can’t perform that action at this time.
0 commit comments