quick.ts
This file
Path
src/preset/quick.ts
24 lines 路 695 bytes 路 TypeScript
Last changed by
Not known.
History of this fileTake it
12345678910111213141516171819202122232425/** * @module * The preset that uses `LinearRouter`. */
import { HonoBase } from '../hono-base'import type { HonoOptions } from '../hono-base'import { LinearRouter } from '../router/linear-router'import { SmartRouter } from '../router/smart-router'import { TrieRouter } from '../router/trie-router'import type { BlankEnv, BlankSchema, Env, Schema } from '../types'
export class Hono< E extends Env = BlankEnv, S extends Schema = BlankSchema, BasePath extends string = '/',> extends HonoBase<E, S, BasePath> { constructor(options: HonoOptions<E> = {}) { super(options) this.router = new SmartRouter({ routers: [new LinearRouter(), new TrieRouter()], }) }}