0
0
mirror of https://github.com/honojs/hono.git synced 2024-11-24 19:26:56 +01:00
hono/benchmarks/deno/faster.ts
2022-07-02 17:51:59 +09:00

19 lines
647 B
TypeScript

import { res, Server } from 'https://deno.land/x/faster@v5.7/mod.ts'
const app = new Server()
app.get('/user', () => {})
app.get('/user/comments', () => {})
app.get('/user/avatar', () => {})
app.get('/user/lookup/email/:address', () => {})
app.get('/event/:id', () => {})
app.get('/event/:id/comments', () => {})
app.post('/event/:id/comments', () => {})
app.post('/status', () => {})
app.get('/very/deeply/nested/route/hello/there', () => {})
app.get('/user/lookup/username/:username', res('json'), async (ctx: any, next: any) => {
ctx.res.body = { message: `Hello ${ctx.params.username}` }
await next()
})
await app.listen({ port: 8000 })