HTTP Methods & Paths in Hono

From the Hono cheat sheet · Routing · verified Jul 2026

HTTP Methods & Paths

Define routes for different HTTP methods

typescript
// HTTP Methods
app.get('/users', (c) => c.text('GET /users'))
app.post('/users', (c) => c.text('POST /users'))
app.put('/users/:id', (c) => c.text('PUT /users/:id'))
app.delete('/users/:id', (c) => c.text('DELETE /users/:id'))
app.patch('/users/:id', (c) => c.text('PATCH'))

// Any HTTP method
app.all('/hello', (c) => c.text('Any Method'))

// Custom method
app.on('PURGE', '/cache', (c) => c.text('PURGE'))

// Multiple methods
app.on(['PUT', 'DELETE'], '/resource', (c) => {
  return c.text('PUT or DELETE')
})
💡 Use app.all() to match any HTTP method
⚡ Wildcards: * matches one segment, trailing * matches all
📌 app.on() for custom methods or multiple methods
🎯 Use app.route() for modular route grouping

More Hono tasks

Back to the full Hono cheat sheet