# IServerLifecycle Interface

Module
import { IServerLifecycle } from "@tsed/common"
Source/packages/common/src/server/interfaces/IServerLifeCycle.ts

# Overview

interface IServerLifecycle extends IHooks {
    version: any;
    $onInit?(): void | Promise<any>;
    $onMountingMiddlewares?(): void | Promise<any>;
    $onRoutesInit?(): void | Promise<any>;
    $onServerReady?(): void | Promise<any>;
    $onServerInitError?(error: any): any;
}

# Members

version: any

$onInit?(): void | Promise<any>

This method is called when the server starting his lifecycle.


$onMountingMiddlewares?(): void | Promise<any>

$onRoutesInit?(): void | Promise<any>

$onServerReady?(): void | Promise<any>

$onServerInitError?(error: any): any