UNPKG

waibu

Version:

Web Framework for Bajo

16 lines (13 loc) 499 B
async function collectRoutePathHandlers () { const { eachPlugins } = this.app.bajo const { isEmpty } = this.lib._ this.routePathHandlers = this.routePathHandlers ?? {} const me = this await eachPlugins(async function ({ ns }) { if (isEmpty(this.routePathHandlers) || !this.routePath) return undefined for (const key of this.routePathHandlers) { me.routePathHandlers[key] = { handler: this.routePath, ns } } }) } export default collectRoutePathHandlers