Skip to content

Platform

@tsed/platform-http

Usage

typescript
import { Platform } from "@tsed/platform-http";

See /packages/platform/platform-http/src/types/common/services/Platform.ts.

Overview

ts
class Platform {
    readonly platformRouters: PlatformRouters;
    constructor();
    get app(): import("./PlatformApplication.js").PlatformApplication<TsED.Application>;
    addRoutes(routes: Route[]): void;
    addRoute(route: string, token: TokenProvider): this;
    getLayers(): PlatformLayer[];
    getMountedControllers(): RouteController[];
}

Description

Platform is used to provide all routes collected by annotation @Controller.

readonly platformRouters

ts
readonly platformRouters: PlatformRouters;

get app

ts
get app(): import("./PlatformApplication.js").PlatformApplication<TsED.Application>;

addRoutes

ts
addRoutes(routes: Route[]): void;

addRoute

ts
addRoute(route: string, token: TokenProvider): this;

getLayers

ts
getLayers(): PlatformLayer[];

getMountedControllers

ts
getMountedControllers(): RouteController[];

Get all controllers mounted on the application.

Released under the MIT License.