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

routing and context

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

Access authenticated user in Hono handlers

Access the authenticated user in a Hono handler using c.get('authUser'). This returns the auth object if the user is authenticated, or null if not authenticated.

Hono route composition with authentication

Create a router with authentication middleware, then mount it on the main app. Example: const v1Router = new Hono().use('*', initAuthConfig(...)).use('*', verifyAuth()).use('/auth/*', authHandler()); const app = new Hono().route('/api/v1', v1Router);

Access validated data with c.req.valid()

After validation passes, retrieve the validated and type-safe data using c.req.valid('json') where the parameter matches the location used in the validator (e.g., 'json' for JSON body validation). The returned data is fully typed according to your schema.

Give your agent this brain