本文整理汇总了TypeScript中shared/router/routerFinder.RouterFinder.findAll方法的典型用法代码示例。如果您正苦于以下问题:TypeScript RouterFinder.findAll方法的具体用法?TypeScript RouterFinder.findAll怎么用?TypeScript RouterFinder.findAll使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类shared/router/routerFinder.RouterFinder
的用法示例。
在下文中一共展示了RouterFinder.findAll方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的TypeScript代码示例。
示例1: enableFor
enableFor (app: express.Express) {
if (app.settings.nunjucksEnv) {
if (app.settings.nunjucksEnv.filters) {
app.settings.nunjucksEnv.filters.renderPaymentSchedule = (value: string, adverbial: boolean = false) => {
switch (value) {
case PaymentSchedule.EACH_WEEK:
return adverbial ? 'Weekly' : 'Every week'
case PaymentSchedule.EVERY_TWO_WEEKS:
return 'Every 2 weeks'
case PaymentSchedule.EVERY_MONTH:
return adverbial ? 'Monthly' : 'Every month'
}
}
app.settings.nunjucksEnv.filters.dashboardStatusForClaimant = (claim: Claim) => render(claim, 'claimant')
app.settings.nunjucksEnv.filters.dashboardStatusForDefendant = (claim: Claim) => render(claim, 'defendant')
}
if (app.settings.nunjucksEnv.globals) {
app.settings.nunjucksEnv.globals.DashboardPaths = Paths
}
}
app.all(/^\/dashboard.*$/, requestHandler())
app.all(/^\/dashboard$/,
DraftMiddleware.requestHandler(new DraftService(), 'claim', 100, (value: any): DraftClaim => {
return new DraftClaim().deserialize(value)
}))
app.use('/', RouterFinder.findAll(path.join(__dirname, 'routes')))
}