mirror of
https://github.com/honojs/hono.git
synced 2024-11-29 17:46:30 +01:00
b253a8735b
* feat: Allow getPath to be replaced. * chore: denoify
19 lines
597 B
TypeScript
19 lines
597 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 } from './types.ts'
|
|
|
|
export class Hono<E extends Env = Env, S = {}, BasePath extends string = ''> extends HonoBase<
|
|
E,
|
|
S,
|
|
BasePath
|
|
> {
|
|
constructor(init: Partial<Pick<Hono, 'router' | 'getPath'> & { strict: boolean }> = {}) {
|
|
super(init)
|
|
this.router = new SmartRouter({
|
|
routers: [new RegExpRouter(), new TrieRouter()],
|
|
})
|
|
}
|
|
}
|