跳到主要内容
版本:Next

Framework

Hierarchy

Index

Constructors

constructor

Properties

app

app: Application

appDir

appDir: any

readonlyapplicationContext

applicationContext: IMidwayContainer

configService

configService: MidwayConfigService

configurationOptions

configurationOptions: IMidwayWebConfigurationOptions

environmentService

environmentService: MidwayEnvironmentService

informationService

informationService: MidwayInformationService

loggerService

loggerService: MidwayLoggerService

middlewareService

middlewareService: MidwayMiddlewareService<Context<unknown>, unknown, unknown>

mockService

mockService: MidwayMockService

Methods

applicationInitialize

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

applyMiddleware

  • applyMiddleware<R, N>(lastMiddleware?: CommonMiddlewareUnion<Context<unknown>, R, N>): Promise<MiddlewareRespond<Context<unknown>, R, N>>
  • Type parameters

    • R
    • N

beforeStop

  • beforeStop(): Promise<void>

publicconfigure

  • configure(): any

createLogger

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

publicgenerateMiddleware

  • generateMiddleware(middlewareId: any): Promise<any>

getAppDir

  • getAppDir(): string

getApplication

  • getApplication(): Application

getApplicationContext

  • getApplicationContext(): IMidwayContainer

getBaseDir

  • getBaseDir(): string

getConfiguration

  • getConfiguration(key?: string): any

getCoreLogger

  • getCoreLogger(): ILogger

getCurrentEnvironment

  • getCurrentEnvironment(): string

getFrameworkName

  • getFrameworkName(): string

getFrameworkType

publicgetLogger

  • getLogger(name?: string): any

getMiddleware

  • getMiddleware(): ContextMiddlewareManager<Context<unknown>, unknown, unknown>

getNamespace

  • getNamespace(): string

getProjectName

  • getProjectName(): string

init

initSingleProcessEgg

  • initSingleProcessEgg(): Promise<void>

initialize

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

isEnable

  • isEnable(): boolean

loadMidwayController

  • loadMidwayController(): Promise<void>

overwriteApplication

  • overwriteApplication(processType: any): void

run

  • run(): Promise<void>

runGuard

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

publicsetContextLoggerClass

  • setContextLoggerClass(): void

setNamespace

  • setNamespace(namespace: string): void

publicsetServer

  • setServer(server: any): void

stop

  • stop(): Promise<void>

useFilter

  • useFilter(filter: CommonFilterUnion<Context<unknown>, unknown, unknown>): void

useGuard

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

useMiddleware

  • useMiddleware(middleware: CommonMiddlewareUnion<Context<unknown>, unknown, unknown>): void