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()
|
2022-01-27 01:09:54 +01:00
|
|
|
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()
|