Member Junction
    Preparing search index...

    Abstract base class for MJServer extensions.

    Extensions are discovered via @RegisterClass(BaseServerExtension, 'DriverClassName') and matched to config entries in mj.config.cjs by their DriverClass name.

    MJServer calls Initialize() during startup, passing the Express app so the extension can register its own routes, middleware, and lifecycle hooks.

    1. MJServer loads the merged serverExtensions[] (Open App packages + host overlay)
    2. For each enabled entry, looks up @RegisterClass(BaseServerExtension, driverClass)
    3. Creates instance via ClassFactory.CreateInstance()
    4. Calls Initialize(context) (or legacy Initialize(app, config)) — extension registers routes
    5. After all extensions across both pre-auth and post-auth phases are mounted, calls OnAllExtensionsMounted(context) if implemented
    6. Periodic HealthCheck() calls for monitoring
    7. On server shutdown, calls Shutdown() for cleanup

    Hierarchy (View Summary)

    Index

    Constructors

    Accessors

    Methods

    • Optional: Called when configuration changes at runtime.

      Not all extensions need to support hot-reloading of configuration. Override this method if your extension can dynamically adjust its behavior without a full restart.

      Parameters

      Returns Promise<void>

    • Graceful shutdown. Called when MJServer is shutting down (SIGTERM/SIGINT).

      Clean up connections, drain in-flight requests, close WebSocket connections, and release any resources held by the extension.

      This method should complete within a reasonable timeout (< 5 seconds). MJServer enforces a 10-second forced shutdown if graceful shutdown hangs.

      Returns Promise<void>