I use separate router files as modules for main app and auth app. I can\'t get the best way to pass variables(db client) into routers. I don\'t want to hardcode it or pass i
It is completely outdated, but you can use global in a script :
global
global.foo = new Foo();
in another script :
foo.bar();
You can also use already existing constant :
Object.foo = new Foo();
And here :
Object.foo.bar();