Interface BackendApplicationServer

This service is responsible for serving the frontend files.

When not bound, @theia/cli generators will bind it on the fly to serve files according to its own layout.

interface BackendApplicationServer {
    configure?(app): MaybePromise<void>;
    initialize?(): MaybePromise<void>;
    onStart?(server): MaybePromise<void>;
    onStop?(app?): void;
}

Hierarchy (view full)

Methods

  • Called after the initialization of the backend application is complete. Use this to configure the Express app before it is started, for example to offer additional endpoints.

    The implementation may be async, however it will still block the configuration step until it's resolved.

    Parameters

    • app: Application

      the express application to configure.

    Returns MaybePromise<void>

    either undefined or a Promise resolving to undefined.

  • Called right after the server for the Express app is started. Use this to additionally configure the server or as ready-signal for your service.

    The implementation may be async, however it will still block the startup step until it's resolved.

    Parameters

    • server: Server<typeof IncomingMessage, typeof ServerResponse> | Server<typeof IncomingMessage, typeof ServerResponse>

      the backend server running the express app.

    Returns MaybePromise<void>

    either undefined or a Promise resolving to undefined.