@midwayjs/coreClassesMidwayWebRouterService版本:Next本页总览MidwayWebRouterService HierarchyMidwayWebRouterServiceMidwayServerlessFunctionServiceIndex ConstructorsconstructorPropertiesoptionsMethodsaddControlleraddRoutergetFlattenRouterTablegetMatchedRouterInfogetRoutePriorityListgetRouterTablesortRouterConstructors constructornew MidwayWebRouterService(options?: RouterCollectorOptions): MidwayWebRouterServiceProperties readonlyoptionsoptions: RouterCollectorOptions = {}Methods publicaddControlleraddController(controllerClz: any, controllerOption: ControllerOption, functionMeta?: boolean): anyaddController(controllerClz: any, controllerOption: ControllerOption, resourceOptions?: { resourceFilter: (routerInfo: RouterInfo) => boolean }, functionMeta?: boolean): anydynamically add a controllerpublicaddRouteraddRouter(routerFunction: (...args: any[]) => void, routerInfoOption: DynamicRouterInfo): voiddynamically add a route to root prefixpublicgetFlattenRouterTablegetFlattenRouterTable(options?: { compileUrlPattern?: boolean }): Promise<RouterInfo[]>publicgetMatchedRouterInfogetMatchedRouterInfo(routerUrl: string, method: string): Promise<RouterInfo>publicgetRoutePriorityListgetRoutePriorityList(): Promise<RouterPriority[]>publicgetRouterTablegetRouterTable(): Promise<Map<string, RouterInfo[]>>publicsortRoutersortRouter(urlMatchList: RouterInfo[]): { _category: number; _level: number; _paramString: string; _pureRouter: string; _weight: number; controllerClz?: new (...args: any[]) => any; controllerId?: string; controllerMiddleware?: any[]; description?: string; fullUrl?: string; fullUrlCompiledRegexp?: RegExp; fullUrlFlattenString?: string; funcHandlerName?: string; functionMetadata?: any; functionName?: string; functionTriggerMetadata?: any; functionTriggerName?: string; handlerName?: string; id?: string; method: string | (...args: any[]) => void; middleware?: any[]; prefix?: string; requestMetadata?: any[]; requestMethod: string; responseMetadata?: any[]; routerName?: string; summary?: string; url: string | RegExp }[]
dynamically add a controller