egg-shell-decorators
egg-shell-decorators copied to clipboard
给EggShell增加通过path获取original target的能力,便于中间件获取对应metaData
// 当eggShell获得path并交给router处理时,顺便登记到map中,并返回get方法.
import {getRouterTarget} from 'egg-shell-decorators';
// 通过此方法,middleware中能通过path得到target, 进而得到metadata
const [target,property] = getRouterTarget(ctx.path, ctx.request.method);
Enhancements to this feature are necessary. Otherwise other custom decorators can't get metadata to do their own thing.
What's going on?