2023-05-09 13:15:10 +00:00
|
|
|
import { HonoBase } from '../hono-base.ts'
|
2023-10-16 21:36:09 +00:00
|
|
|
import type { HonoOptions } from '../hono-base.ts'
|
2023-05-09 13:15:10 +00:00
|
|
|
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-08-24 06:36:49 +00:00
|
|
|
import type { Env, Schema } from '../types.ts'
|
2023-05-09 13:15:10 +00:00
|
|
|
|
2023-08-24 06:36:49 +00:00
|
|
|
export class Hono<
|
|
|
|
E extends Env = Env,
|
|
|
|
S extends Schema = {},
|
|
|
|
BasePath extends string = '/'
|
|
|
|
> extends HonoBase<E, S, BasePath> {
|
2023-10-16 21:36:09 +00:00
|
|
|
constructor(options: HonoOptions<E> = {}) {
|
|
|
|
super(options)
|
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
|
|
|
}
|
|
|
|
}
|