Options
All
  • Public
  • Public/Protected
  • All
Menu

Class NestApplication

publicapi

Hierarchy

Implements

  • INestApplicationContext
  • INestApplication

Index

Constructors

constructor

Properties

Private Readonly appOptions

appOptions: NestApplicationOptions

Private Readonly config

Protected Readonly container

container: NestContainer

Private Readonly httpAdapter

httpAdapter: HttpServer

Private httpServer

httpServer: any

Protected Readonly injector

injector: Injector = new Injector()

Protected isInitialized

isInitialized: boolean = false

Private isListening

isListening: boolean = false

Private Readonly logger

logger: Logger = new Logger(NestApplication.name, true)

Private Readonly microservices

microservices: any[] = []

Private Readonly microservicesModule

microservicesModule: any = MicroservicesModule && new MicroservicesModule()

Private Readonly middlewareContainer

middlewareContainer: MiddlewareContainer = new MiddlewareContainer(this.container,)

Private Readonly middlewareModule

middlewareModule: MiddlewareModule = new MiddlewareModule()

Private Readonly routesResolver

routesResolver: Resolver

Private Readonly socketModule

socketModule: any = SocketModule && new SocketModule()

Methods

applyOptions

  • applyOptions(): void

Protected callBeforeShutdownHook

  • callBeforeShutdownHook(signal?: string): Promise<void>

Protected callBootstrapHook

  • callBootstrapHook(): Promise<void>

Protected callDestroyHook

  • callDestroyHook(): Promise<void>

Protected callInitHook

  • callInitHook(): Promise<void>

Protected callShutdownHook

  • callShutdownHook(signal?: string): Promise<void>

close

  • close(): Promise<void>

connectMicroservice

  • connectMicroservice<T>(microserviceOptions: T, hybridAppOptions?: NestHybridApplicationOptions): INestMicroservice
  • Type parameters

    • T: object

    Parameters

    • microserviceOptions: T
    • Default value hybridAppOptions: NestHybridApplicationOptions = {}

    Returns INestMicroservice

createServer

  • createServer<T>(): T

Protected dispose

  • dispose(): Promise<void>

enableCors

  • enableCors(options?: CorsOptions): void

enableShutdownHooks

Protected find

  • find<TInput, TResult>(typeOrToken: Type<TInput> | Abstract<TInput> | string | symbol, contextModule?: Module): TResult

get

  • get<TInput, TResult>(typeOrToken: Type<TInput> | Abstract<TInput> | string | symbol, options?: { strict: boolean }): TResult

getHttpAdapter

getHttpServer

  • getHttpServer(): any

getMicroservices

  • getMicroservices(): INestMicroservice[]

Private getProtocol

  • getProtocol(): "http" | "https"

getUnderlyingHttpServer

  • getUnderlyingHttpServer<T>(): T

getUrl

  • getUrl(): Promise<string>

Private host

  • host(): string | undefined

init

  • init(): Promise<this>

listen

  • listen(port: number | string, callback?: () => void): Promise<any>
  • listen(port: number | string, hostname: string, callback?: () => void): Promise<any>

listenAsync

  • listenAsync(port: number | string, hostname?: string): Promise<any>

Private listenToPromise

  • listenToPromise(microservice: INestMicroservice): Promise<unknown>

Protected listenToShutdownSignals

  • listenToShutdownSignals(signals: string[]): void

registerHttpServer

  • registerHttpServer(): void

Private registerMiddleware

  • registerMiddleware(instance: any): Promise<void>

registerModules

  • registerModules(): Promise<void>

registerParserMiddleware

  • registerParserMiddleware(): void

registerRequestByContextId

  • registerRequestByContextId<T>(request: T, contextId: ContextId): void

registerRouter

  • registerRouter(): Promise<void>

registerRouterHooks

  • registerRouterHooks(): Promise<void>

registerWsModule

  • registerWsModule(): void

resolve

  • resolve<TInput, TResult>(typeOrToken: Type<TInput> | Abstract<TInput> | string | symbol, contextId?: ContextId, options?: { strict: boolean }): Promise<TResult>

Protected resolvePerContext

  • resolvePerContext<TInput, TResult>(typeOrToken: Type<TInput> | Abstract<TInput> | string | symbol, contextModule: Module, contextId: ContextId, options?: { strict: boolean }): Promise<TResult>

select

  • select<T>(moduleType: Type<T>): INestApplicationContext

selectContextModule

  • selectContextModule(): void

setBaseViewsDir

  • setBaseViewsDir(path: string | string[]): this

setGlobalPrefix

  • setGlobalPrefix(prefix: string): this

setViewEngine

  • setViewEngine(engineOrOptions: any): this

startAllMicroservices

  • startAllMicroservices(callback?: () => void): this

startAllMicroservicesAsync

  • startAllMicroservicesAsync(): Promise<void>

Protected unsubscribeFromProcessSignals

  • unsubscribeFromProcessSignals(): void

use

  • use(...args: [any, any]): this

useGlobalFilters

  • useGlobalFilters(...filters: ExceptionFilter[]): this

useGlobalGuards

  • useGlobalGuards(...guards: CanActivate[]): this

useGlobalInterceptors

  • useGlobalInterceptors(...interceptors: NestInterceptor[]): this

useGlobalPipes

  • useGlobalPipes(...pipes: PipeTransform<any>[]): this

useLogger

  • useLogger(logger: LoggerService | LogLevel[] | false): void

useStaticAssets

  • useStaticAssets(options: any): this
  • useStaticAssets(path: string, options?: any): this

useWebSocketAdapter

  • useWebSocketAdapter(adapter: WebSocketAdapter): this

Generated using TypeDoc