UNPKG

@tsed/platform-http

Version:
21 lines (20 loc) 600 B
import { injectable, ProviderScope } from "@tsed/di"; import { PlatformRouter } from "@tsed/platform-router"; /** * `PlatformApplication` is used to provide all routes collected by annotation `@Controller`. * * @platform */ export class PlatformApplication extends PlatformRouter { rawCallback() { } getApp() { return this.rawApp; } callback(req, res) { if (req && res) { return this.callback()(req, res); } return this.rawCallback(); } } injectable(PlatformApplication).scope(ProviderScope.SINGLETON).alias("PlatformApplication");