2023-05-09 13:15:10 +00:00
|
|
|
import { HonoBase } from '../hono-base.ts'
|
|
|
|
import { LinearRouter } from '../router/linear-router/index.ts'
|
2023-07-20 08:43:35 +00:00
|
|
|
import { SmartRouter } from '../router/smart-router/index.ts'
|
|
|
|
import { TrieRouter } from '../router/trie-router/index.ts'
|
2023-05-09 13:15:10 +00:00
|
|
|
import type { Env } from '../types.ts'
|
|
|
|
|
2023-05-13 23:18:45 +00:00
|
|
|
export class Hono<E extends Env = Env, S = {}, BasePath extends string = '/'> extends HonoBase<
|
2023-05-09 13:15:10 +00:00
|
|
|
E,
|
|
|
|
S,
|
|
|
|
BasePath
|
|
|
|
> {
|
2023-05-18 05:18:55 +00:00
|
|
|
constructor(init: Partial<Pick<Hono, 'getPath'> & { strict: boolean }> = {}) {
|
|
|
|
super(init)
|
2023-07-20 08:43:35 +00:00
|
|
|
this.router = new SmartRouter({
|
|
|
|
routers: [new LinearRouter(), new TrieRouter()],
|
|
|
|
})
|
2023-05-09 13:15:10 +00:00
|
|
|
}
|
|
|
|
}
|