# PlatformBuilder Class

Module
import { PlatformBuilder } from "@tsed/common"
Source/packages/common/src/platform-builder/builder/PlatformBuilder.ts

# Overview

abstract class PlatformBuilder {
    protected startedAt: Date;
    protected _rootModule: any;
    protected _injector: InjectorService;
    get injector(): InjectorService;
    get rootModule(): any;
    get app(): PlatformApplication;
    get platform(): Platform;
    /**
     * Return the settings configured by the decorator @@Configuration@@.
     *
     * ```typescript
     * @Configuration({
     *    rootDir: Path.resolve(__dirname),
     *    port: 8000,
     *    httpsPort: 8080,
     *    mount: {
     *      "/rest": "${rootDir}/controllers/**\/*.js"
     *    }
     * })
     * export class Server {
     *     $onInit(){
     *         console.log(this.settings); // {rootDir, port, httpsPort,...}
     *     }
     * }
     * ```
     *
     * @returns {ServerSettingsService}
     */
    get settings(): TsED.Configuration & import("@tsed/di").DIConfiguration;
    get logger(): import("@tsed/di").IDILogger;
    static build<T extends PlatformBuilder>(platformBuildClass: Type<T>): T;
    /**
     * Add classes to the components list
     * @param classes
     */
    addComponents(classes: any | any[]): this;
    /**
     * Add classes decorated by @@Controller@@ to components container.
     *
     * ### Example
     *
     * ```typescript
     * @Controller('/ctrl')
     * class MyController{
     * }
     *
     * platform.addControllers('/rest', [MyController])
     * ```
     *
     * ::: tip
     * If the MyController class isn't decorated, the class will be ignored.
     * :::
     *
     * @param {string} endpoint
     * @param {any[]} controllers
     */
    addControllers(endpoint: string, controllers: any | string | (any | string)[]): void;
    runLifecycle(): Promise<void>;
    loadInjector(): Promise<void>;
    listen(): Promise<void>;
    ready(): Promise<void>;
    callHook(key: string, ...args: any[]): Promise<void>;
    protected bootstrap(module: Type<any>, settings?: Partial<TsED.Configuration>): Promise<this>;
    protected abstract loadStatics(): Promise<void>;
    protected listenServers(): Promise<void>;
    protected logRoutes(): void;
    protected createContext(): Promise<PlatformApplication>;
    protected loadRoutes(routes: IRoute[]): Promise<void>;
    protected createInjector(module: Type<any>, settings: any): void;
    protected createRootModule(module: Type<any>): void;
}