@4lch4/koa-router-printer 中文文档教程
@4lch4/koa-router-printer
这个 repo 是一个轻量级的实用程序,适用于使用 @koa/router 的 Koa.js 应用程序。 它输出一个包含已注册路径和方法的两列表。
Examples
注意:这些示例也可以在示例目录 中找到。
Example 0
Printer(app, {
displayHead: false,
displayPrefix: true
})
Example 1
Printer(app, {
displayHead: true,
displayPrefix: false
})
Options
该模块接受两个选项以及 app 参数:
displayHead
- Whether or not to display the HEAD method with a path.
displayPrefix
- Whether or not to display the prefix ahead of each Route path.
@4lch4/koa-router-printer
This repo is a lightweight utility for Koa.js applications that utilize @koa/router. It outputs a two-column table containing the registered path(s) and method(s).
Examples
NOTE: These examples are also available in the examples directory.
Example 0
Printer(app, {
displayHead: false,
displayPrefix: true
})
Example 1
Printer(app, {
displayHead: true,
displayPrefix: false
})
Options
The module accepts two options along with the app parameter:
displayHead
- Whether or not to display the HEAD method with a path.
displayPrefix
- Whether or not to display the prefix ahead of each Route path.