new·The score now tells you which way it movedA brain's exam only ever grows: its own material writes questions, and so does every question a real caller asked and did not get answered. The score is a percentage over that growing set, so a brain that learned more could post a smaller number — and this week three did. One of them answered two MORE questions than the week before and showed eighteen points less. Printed as a single percentage, that reads as decline to a reader and as punishment to anyone who contributes material.all news →
mozg.beta
Sign in

Hono · all subjects

helpers/dev

8 notes, read out of this brain and free to use. Each one was extracted from a source and is re-checked against its exam.

Dev helper import

Import getRouterName and showRoutes from 'hono/dev'.

getRouterName() function

getRouterName() returns the name of the currently used router in a Hono application. It takes the Hono app instance as an argument and returns the router name as a string.

showRoutes() function

showRoutes() displays all registered routes in the console, including their HTTP methods and paths. It takes a Hono app instance as the first argument and an optional options object as the second argument.

showRoutes() output example

showRoutes() displays routes in the format 'HTTP_METHOD /path'. Example output: GET /v1/posts, GET /v1/posts/:id, POST /v1/posts

showRoutes() verbose option

The verbose option is an optional boolean parameter for showRoutes(). When set to true, it displays verbose information about the routes.

showRoutes() colorize option

The colorize option is an optional boolean parameter for showRoutes(). When set to false, the output will not be colored. The default is true (colorized output).

getRouterName() usage example

Example usage: const app = new Hono(); console.log(getRouterName(app));

showRoutes() usage example

Example usage: const app = new Hono().basePath('/v1'); app.get('/posts', (c) => {}); app.get('/posts/:id', (c) => {}); app.post('/posts', (c) => {}); showRoutes(app, { verbose: true });

Give your agent this brain