Options
All
  • Public
  • Public/Protected
  • All
Menu

Class NestApplication

publicapi

Hierarchy

  • NestApplicationContext
    • NestApplication

Implements

  • INestApplicationContext

Index

Constructors

constructor

  • new NestApplication(container: any, httpAdapter: any, config: any, appOptions?: {}): NestApplication
  • Parameters

    • container: any
    • httpAdapter: any
    • config: any
    • Default value appOptions: {} = {}

    Returns NestApplication

Properties

Protected Readonly container

container: NestContainer

Protected Readonly injector

injector: Injector

Protected isInitialized

isInitialized: boolean

Methods

applyOptions

  • applyOptions(): void
  • Returns void

Protected callBeforeShutdownHook

  • callBeforeShutdownHook(signal?: string): Promise<void>
  • Calls the beforeApplicationShutdown function on the registered modules and children.

    Parameters

    • Optional signal: string

    Returns Promise<void>

Protected callBootstrapHook

  • callBootstrapHook(): Promise<void>
  • Calls the onApplicationBootstrap function on the registered modules and its children.

    Returns Promise<void>

Protected callDestroyHook

  • callDestroyHook(): Promise<void>
  • Calls the onModuleDestroy function on the registered modules and its children.

    Returns Promise<void>

Protected callInitHook

  • callInitHook(): Promise<void>
  • Calls the onModuleInit function on the registered modules and its children.

    Returns Promise<void>

Protected callShutdownHook

  • callShutdownHook(signal?: string): Promise<void>
  • Calls the onApplicationShutdown function on the registered modules and children.

    Parameters

    • Optional signal: string

    Returns Promise<void>

close

  • close(): Promise<void>
  • Returns Promise<void>

connectMicroservice

  • connectMicroservice(microserviceOptions: any, hybridAppOptions?: {}): any
  • Parameters

    • microserviceOptions: any
    • Default value hybridAppOptions: {} = {}

    Returns any

createServer

  • createServer(): any
  • Returns any

dispose

  • dispose(): Promise<void>
  • Returns Promise<void>

enableCors

  • enableCors(options: any): void
  • Parameters

    • options: any

    Returns void

enableShutdownHooks

  • Enables the usage of shutdown hooks. Will call the onApplicationShutdown function of a provider if the process receives a shutdown signal.

    Parameters

    Returns this

    The Nest application context instance

Protected find

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

    • TInput = any

    • TResult = TInput

    Parameters

    • typeOrToken: Type<TInput> | Abstract<TInput> | string | symbol
    • Optional contextModule: Module

    Returns TResult

get

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

    • TInput = any

    • TResult = TInput

    Parameters

    • typeOrToken: Type<TInput> | Abstract<TInput> | string | symbol
    • Optional options: { strict: boolean }
      • strict: boolean

    Returns TResult

getHttpAdapter

  • getHttpAdapter(): any
  • Returns any

getHttpServer

  • getHttpServer(): any
  • Returns any

getMicroservices

  • getMicroservices(): any[]
  • Returns any[]

getProtocol

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

getUnderlyingHttpServer

  • getUnderlyingHttpServer(): any
  • Returns any

getUrl

  • getUrl(): Promise<any>
  • Returns Promise<any>

host

  • host(): any
  • Returns any

init

  • init(): Promise<this>
  • Returns Promise<this>

listen

  • listen(port: any, ...args: any[]): Promise<any>
  • Parameters

    • port: any
    • Rest ...args: any[]

    Returns Promise<any>

listenAsync

  • listenAsync(port: any, hostname: any): Promise<any>
  • Parameters

    • port: any
    • hostname: any

    Returns Promise<any>

listenToPromise

  • listenToPromise(microservice: any): Promise<any>
  • Parameters

    • microservice: any

    Returns Promise<any>

Protected listenToShutdownSignals

  • listenToShutdownSignals(signals: string[]): void
  • Listens to shutdown signals by listening to process events

    Parameters

    • signals: string[]

      The system signals it should listen to

    Returns void

registerHttpServer

  • registerHttpServer(): void
  • Returns void

registerMiddleware

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

    • instance: any

    Returns Promise<void>

registerModules

  • registerModules(): Promise<void>
  • Returns Promise<void>

registerParserMiddleware

  • registerParserMiddleware(): void
  • Returns void

registerRequestByContextId

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

    • T = any

    Parameters

    • request: T
    • contextId: ContextId

    Returns void

registerRouter

  • registerRouter(): Promise<void>
  • Returns Promise<void>

registerRouterHooks

  • registerRouterHooks(): Promise<void>
  • Returns Promise<void>

registerWsModule

  • registerWsModule(): void
  • Returns void

resolve

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

    • TInput = any

    • TResult = TInput

    Parameters

    • typeOrToken: Type<TInput> | Abstract<TInput> | string | symbol
    • Optional contextId: ContextId
    • Optional options: { strict: boolean }
      • strict: boolean

    Returns Promise<TResult>

Protected resolvePerContext

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

    • TInput = any

    • TResult = TInput

    Parameters

    • typeOrToken: Type<TInput> | Abstract<TInput> | string | symbol
    • contextModule: Module
    • contextId: ContextId
    • Optional options: { strict: boolean }
      • strict: boolean

    Returns Promise<TResult>

select

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

    • T

    Parameters

    • moduleType: Type<T>

    Returns INestApplicationContext

selectContextModule

  • selectContextModule(): void

setBaseViewsDir

  • setBaseViewsDir(path: any): this
  • Parameters

    • path: any

    Returns this

setGlobalPrefix

  • setGlobalPrefix(prefix: any): this
  • Parameters

    • prefix: any

    Returns this

setViewEngine

  • setViewEngine(engineOrOptions: any): this
  • Parameters

    • engineOrOptions: any

    Returns this

startAllMicroservices

  • startAllMicroservices(callback: any): this
  • Parameters

    • callback: any

    Returns this

startAllMicroservicesAsync

  • startAllMicroservicesAsync(): Promise<any>
  • Returns Promise<any>

Protected unsubscribeFromProcessSignals

  • unsubscribeFromProcessSignals(): void

use

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

    • Rest ...args: any[]

    Returns this

useGlobalFilters

  • useGlobalFilters(...filters: any[]): this
  • Parameters

    • Rest ...filters: any[]

    Returns this

useGlobalGuards

  • useGlobalGuards(...guards: any[]): this
  • Parameters

    • Rest ...guards: any[]

    Returns this

useGlobalInterceptors

  • useGlobalInterceptors(...interceptors: any[]): this
  • Parameters

    • Rest ...interceptors: any[]

    Returns this

useGlobalPipes

  • useGlobalPipes(...pipes: any[]): this
  • Parameters

    • Rest ...pipes: any[]

    Returns this

useLogger

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

    • logger: LoggerService | LogLevel[] | false

    Returns void

useStaticAssets

  • useStaticAssets(pathOrOptions: any, options: any): this
  • Parameters

    • pathOrOptions: any
    • options: any

    Returns this

useWebSocketAdapter

  • useWebSocketAdapter(adapter: any): this
  • Parameters

    • adapter: any

    Returns this

Generated using TypeDoc