0
0
mirror of https://github.com/honojs/hono.git synced 2024-11-25 13:19:30 +01:00
hono/deno_dist/hono.ts

22 lines
662 B
TypeScript
Raw Normal View History

import { HonoBase } from './hono-base.ts'
import type { HonoOptions } from './hono-base.ts'
import { RegExpRouter } from './router/reg-exp-router/index.ts'
import { SmartRouter } from './router/smart-router/index.ts'
import { TrieRouter } from './router/trie-router/index.ts'
import type { Env, Schema } from './types.ts'
2022-07-02 08:09:45 +02:00
export class Hono<
E extends Env = Env,
S extends Schema = {},
BasePath extends string = '/'
> extends HonoBase<E, S, BasePath> {
constructor(options: HonoOptions<E> = {}) {
super(options)
this.router =
options.router ??
new SmartRouter({
routers: [new RegExpRouter(), new TrieRouter()],
})
2022-07-02 08:09:45 +02:00
}
}