跳到主要内容
版本:Next

Framework

Hierarchy

Index

Constructors

constructor

Properties

app

readonlyapplicationContext

applicationContext: IMidwayContainer

configService

configService: MidwayConfigService

configurationOptions

configurationOptions: IMidwayKoaConfigurationOptions

environmentService

environmentService: MidwayEnvironmentService

informationService

informationService: MidwayInformationService

loggerService

loggerService: MidwayLoggerService

middlewareService

middlewareService: MidwayMiddlewareService<IMidwayKoaContext, Next, unknown>

mockService

mockService: MidwayMockService

Methods

applicationInitialize

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

applyMiddleware

  • Type parameters

    • R
    • N

publicbeforeStop

  • beforeStop(): Promise<void>

configure

createLogger

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

publicgenerateController

  • generateController(routeInfo: RouterInfo): Middleware<DefaultState, IMidwayKoaContext, any>
  • wrap controller string to middleware function

publicgenerateMiddleware

  • generateMiddleware(middlewareId: any): Promise<Middleware<DefaultState, IMidwayKoaContext, any>>
  • @deprecated

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

getNamespace

  • getNamespace(): string

publicgetPort

  • getPort(): string

getProjectName

  • getProjectName(): string

publicgetServer

  • getServer(): Server<typeof IncomingMessage, typeof ServerResponse>

init

initialize

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

isEnable

  • isEnable(): boolean

loadMidwayController

  • loadMidwayController(): Promise<void>

publicrun

  • run(): Promise<void>

runGuard

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

setNamespace

  • setNamespace(namespace: string): void

stop

  • stop(): Promise<void>

publicuseFilter

useGuard

publicuseMiddleware

  • useMiddleware(Middleware: CommonMiddlewareUnion<IMidwayKoaContext, Next, unknown>): void