Member Junction
    Preparing search index...

    Interface ServerMiddlewareContext

    What the server hands each middleware at startup.

    interface ServerMiddlewareContext {
        ApiRoute: (subpath: string, options?: { absolute?: boolean }) => string;
    }
    Index

    Properties

    Properties

    ApiRoute: (subpath: string, options?: { absolute?: boolean }) => string

    Builds the path of a route under MJAPI's base path (MJAPI_BASE_PATH). subpath must start with /. Use it for every route a middleware registers or compares against. With { absolute: true } it returns the public URL of the route (MJAPI_PUBLIC_URL + subpath). The options type is written out here, not imported from apiRoot.ts: packages that read this file's types from source must not compile config.ts.