Documentation
    Preparing search index...

    Interface ServerAdapter

    interface ServerAdapter {
        addEndpoint(
            handler: EndpointHandler,
            endpointRoot: string,
            options?: EndpointOptions,
        ): void;
        addMiddleware?(middleware: ApiMiddleware): void;
        createRouter(path: string): ServerAdapter;
        delete(path: string, ...handlers: ApiHandler[]): void;
        delete(path: string, ...handlers: any[]): void;
        get(path: string, ...handlers: ApiHandler[]): void;
        get(path: string, ...handlers: any[]): void;
        getNativeInstance(): any;
        patch(path: string, ...handlers: ApiHandler[]): void;
        patch(path: string, ...handlers: any[]): void;
        post(path: string, ...handlers: ApiHandler[]): void;
        post(path: string, ...handlers: any[]): void;
        put(path: string, ...handlers: ApiHandler[]): void;
        put(path: string, ...handlers: any[]): void;
        serveStatic(folderPath: string, apiPrefix?: string): void;
        start(port: number, callback?: () => void): void;
        use(...args: any[]): void;
    }

    Implemented by

    Index

    Methods

    • Parameters

      Returns void

    • Parameters

      • path: string
      • ...handlers: any[]

      Returns void

    • Parameters

      Returns void

    • Parameters

      • path: string
      • ...handlers: any[]

      Returns void

    • Returns any

    • Parameters

      Returns void

    • Parameters

      • path: string
      • ...handlers: any[]

      Returns void

    post

    • post(path: string, ...handlers: ApiHandler[]): void

      Parameters

      Returns void

    • post(path: string, ...handlers: any[]): void

      Parameters

      • path: string
      • ...handlers: any[]

      Returns void

    • Parameters

      Returns void

    • Parameters

      • path: string
      • ...handlers: any[]

      Returns void

    • Configures the server to serve static files from a specified folder. Automatically handles fallback routing for Single Page Applications (SPA).

      Parameters

      • folderPath: string

        The absolute path to the directory containing static files.

      • OptionalapiPrefix: string

        The prefix used for API routes (ignored by SPA fallback).

      Returns void

    • Parameters

      • port: number
      • Optionalcallback: () => void

      Returns void

    • Parameters

      • ...args: any[]

      Returns void