Express Sweet API Reference - v3.0.0
    Preparing search index...

    Class Global

    Set global variables accessible throughout the application. Variables can be accessed like "global.xxx" in all router and model classes.

    Global variables set:

    • APP_DIR: The directory where app.js is located (process.cwd())
    // Access in any router or model
    console.log(global.APP_DIR); // "/path/to/your/app"
    Index

    Constructors

    Methods

    Constructors

    Methods

    • Mount global variables on application. Sets up global.APP_DIR for access throughout the application.

      Returns void

      // This method is called automatically by express-sweet.mount()
      import Global from './middlewares/Global';

      Global.mount();