跳到主要内容
版本:Next

Framework

Hierarchy

Index

Constructors

constructor

Properties

publicapp

readonlyapplicationContext

applicationContext: IMidwayContainer

configService

configService: MidwayConfigService

configurationOptions

environmentService

environmentService: MidwayEnvironmentService

informationService

informationService: MidwayInformationService

loggerService

loggerService: MidwayLoggerService

middlewareService

middlewareService: MidwayMiddlewareService<Context, Response<any, Record<string, any>>, NextFunction>

mockService

mockService: MidwayMockService

Methods

applicationInitialize

  • applicationInitialize(options: Partial<IMidwayBootstrapOptions>): Promise<void>

publicapplyMiddleware

  • applyMiddleware<Response, NextFunction>(): Promise<MiddlewareRespond<Context, Response, NextFunction>>
  • Type parameters

    • Response
    • NextFunction

publicbeforeStop

  • beforeStop(): Promise<void>

configure

createLogger

  • createLogger(name: string, option?: MidwayLoggerOptions): any

getAppDir

  • getAppDir(): string

getApplication

getApplicationContext

  • getApplicationContext(): IMidwayContainer

getBaseDir

  • getBaseDir(): string

getConfiguration

  • getConfiguration(key?: string): any

getCoreLogger

  • getCoreLogger(): ILogger

getCurrentEnvironment

  • getCurrentEnvironment(): string

publicgetFrameworkName

  • getFrameworkName(): string

publicgetFrameworkType

getLogger

  • getLogger(name?: string): any

getMiddleware

  • getMiddleware(): ContextMiddlewareManager<Context, Response<any, Record<string, any>>, NextFunction>

getNamespace

  • getNamespace(): string

publicgetPort

  • getPort(): string

getProjectName

  • getProjectName(): string

publicgetServer

  • getServer(): Server

init

initialize

  • initialize(options?: IMidwayBootstrapOptions): Promise<void>

isEnable

  • isEnable(): boolean

publicloadMidwayController

  • loadMidwayController(): Promise<{ middleware: any; prefix: string }[]>

publicrun

  • run(): Promise<void>

runGuard

  • runGuard(ctx: Context, supplierClz: new (...args: any[]) => any, methodName: string): Promise<boolean>

setNamespace

  • setNamespace(namespace: string): void

stop

  • stop(): Promise<void>

useFilter

  • useFilter(filter: CommonFilterUnion<Context, Response<any, Record<string, any>>, NextFunction>): void

useGuard

  • useGuard(guards: CommonGuardUnion<Context>): void

useMiddleware

  • useMiddleware(middleware: CommonMiddlewareUnion<Context, Response<any, Record<string, any>>, NextFunction>): void

publicuseRouterMiddleware

  • useRouterMiddleware(routerPath: string, middleware: any): void