router: true

This commit is contained in:
Chris Wanstrath 2026-01-29 18:31:32 -08:00
parent 85fa79518c
commit a7ad3a5c1d

View File

@ -24,6 +24,7 @@ export type HypeProps = {
reset?: boolean reset?: boolean
prettyHTML?: boolean prettyHTML?: boolean
layout?: boolean layout?: boolean
router?: boolean
} }
export type SSEHandler<E extends Env> = ( export type SSEHandler<E extends Env> = (
@ -44,7 +45,8 @@ export class Hype<
super(props) super(props)
this.props = props ?? {} this.props = props ?? {}
this.registerMiddleware() if (!this.router)
this.registerMiddleware()
} }
sse(path: string, handler: SSEHandler<E>) { sse(path: string, handler: SSEHandler<E>) {
@ -240,4 +242,4 @@ function findAvailablePort(startPort: number, maxAttempts = 100): number {
function render404(c: Context) { function render404(c: Context) {
return c.text('File not found', 404) return c.text('File not found', 404)
} }