本页还没有译文
本页 13 段还没译成한국어,下面显示的是英文原文。Dev Helper
还没翻译译自英文(hono.dev)本页 13 段都还没译
Dev Helper
Dev Helper provides useful methods you can use in development.
import { Hono } from 'hono'
import { getRouterName, showRoutes } from 'hono/dev'getRouterName()
You can get the name of the currently used router with getRouterName().
const app = new Hono()
// ...
console.log(getRouterName(app))showRoutes()
showRoutes() function displays the registered routes in your console.
Consider an application like the following:
const app = new Hono().basePath('/v1')
app.get('/posts', (c) => {
// ...
})
app.get('/posts/:id', (c) => {
// ...
})
app.post('/posts', (c) => {
// ...
})
showRoutes(app, {
verbose: true,
})When this application starts running, the routes will be shown in your console as follows:
GET /v1/posts
GET /v1/posts/:id
POST /v1/postsOptions
optional verbose: boolean
When set to true, it displays verbose information.
optional colorize: boolean
When set to false, the output will not be colored.
AI 翻译查看英文原文