0
0
mirror of https://github.com/honojs/hono.git synced 2024-12-01 10:51:01 +00:00
hono/benchmarks/webapp/hono.js

19 lines
782 B
JavaScript
Raw Normal View History

2022-05-26 00:09:01 +00:00
import { Hono } from '../../dist/hono'
2022-05-12 23:48:04 +00:00
//import { Hono } from 'hono'
2021-12-27 23:51:05 +00:00
2022-05-26 00:09:01 +00:00
const hono = new Hono()
hono.get('/user', (c) => c.text('User'))
hono.get('/user/comments', (c) => c.text('User Comments'))
hono.get('/user/avatar', (c) => c.text('User Avatar'))
hono.get('/user/lookup/email/:address', (c) => c.text('User Lookup Email Address'))
hono.get('/event/:id', (c) => c.text('Event'))
hono.get('/event/:id/comments', (c) => c.text('Event Comments'))
hono.post('/event/:id/comments', (c) => c.text('POST Event Comments'))
hono.post('/status', (c) => c.text('Status'))
hono.get('/very/deeply/nested/route/hello/there', (c) => c.text('Very Deeply Nested Route'))
2021-12-27 23:51:05 +00:00
hono.get('/user/lookup/username/:username', (c) => {
2022-05-26 00:09:01 +00:00
return new Response(`Hello ${c.req.param('username')}`)
2021-12-27 23:51:05 +00:00
})
hono.fire()