Set global variables accessible throughout the application. Variables can be accessed like "global.xxx" in all router and model classes.
Global variables set:
// Access in any router or modelconsole.log(global.APP_DIR); // "/path/to/your/app" Copy
// Access in any router or modelconsole.log(global.APP_DIR); // "/path/to/your/app"
Static
Mount global variables on application. Sets up global.APP_DIR for access throughout the application.
// This method is called automatically by express-sweet.mount()import Global from './middlewares/Global';Global.mount(); Copy
// This method is called automatically by express-sweet.mount()import Global from './middlewares/Global';Global.mount();
Set global variables accessible throughout the application. Variables can be accessed like "global.xxx" in all router and model classes.
Global variables set:
Example