Import
Functions
createFactory()
Creates a factory instance for creating type-safe Hono components.(app: Hono<E>) => void
Optional function to initialize new app instances
HonoOptions<E>
Default options for created apps
Factory<E, P>
A factory instance with methods for creating apps, middleware, and handlers
createMiddleware()
Creates type-safe middleware without needing a factory instance.MiddlewareHandler
required
The middleware handler function
MiddlewareHandler
The same middleware with proper type inference
Factory Methods
factory.createApp()
Creates a new Hono application instance.HonoOptions<E>
Options for the Hono app (merged with default options)
Hono<E>
A new Hono application instance
factory.createMiddleware()
Creates type-safe middleware with the factory’s environment types.MiddlewareHandler
required
The middleware handler function
MiddlewareHandler
Type-safe middleware
factory.createHandlers()
Creates an array of type-safe handlers.H[]
required
Variable number of handler functions
H[]
Array of handlers with proper type inference