mirror of
https://github.com/honojs/hono.git
synced 2024-11-30 01:56:18 +01:00
6034dd7f7f
* fix(types): remove type-errors for routes * denoify * fixed the client and the presets * rename
21 lines
652 B
TypeScript
21 lines
652 B
TypeScript
import { HonoBase } 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'
|
|
|
|
export class Hono<
|
|
E extends Env = Env,
|
|
S extends Schema = {},
|
|
BasePath extends string = '/'
|
|
> extends HonoBase<E, S, BasePath> {
|
|
constructor(init: Partial<Pick<Hono, 'router' | 'getPath'> & { strict: boolean }> = {}) {
|
|
super(init)
|
|
this.router =
|
|
init.router ??
|
|
new SmartRouter({
|
|
routers: [new RegExpRouter(), new TrieRouter()],
|
|
})
|
|
}
|
|
}
|