Skip to content

v2.6.0

Compare
Choose a tag to compare
@G4brym G4brym released this 16 Jan 14:42
· 3 commits to main since this release
066ca70

What's Changed

  • Add support for .route() and .all() for Hono and improve Hono types by @G4brym in #229

You can now use .route() to have nested routers, and .all() to have a class handle all HTTP methods

const authors = fromHono(new Hono())
  .get('/', ListAuthors)
  .post('/', CreateAuthor)
  .get('/:id', GetAuthor)

const books = fromHono(new Hono())
  .get('/', ListBooks)
  .post('/', CreateBook)
  .get('/:id', GetBook)

const app = fromHono(new Hono())
app.route('/authors', authors)
app.route('/books', books)

app.all('/events', EventsCatchAll) // .all() will not register any method in the openapi schema

export default app;

Full Changelog: v2.5.4...v2.6.0