0
0
mirror of https://github.com/honojs/hono.git synced 2024-11-22 11:17:33 +01:00
hono/benchmarks/webapp/hono.js

19 lines
782 B
JavaScript
Raw Normal View History

2022-05-26 02:09:01 +02:00
import { Hono } from '../../dist/hono'
2022-05-13 01:48:04 +02:00
//import { Hono } from 'hono'
2021-12-28 00:51:05 +01:00
2022-05-26 02:09:01 +02: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-28 00:51:05 +01:00
hono.get('/user/lookup/username/:username', (c) => {
2022-05-26 02:09:01 +02:00
return new Response(`Hello ${c.req.param('username')}`)
2021-12-28 00:51:05 +01:00
})
hono.fire()