Hono
let make: unit => t
Creates a new Hono application instance
src/Hono.res:4:1
let make: unit => t
Creates a new Hono application instance
src/Hono.res:9:5
reqHeaders
Section titled “reqHeaders”type reqHeaders = {get: string => option<string>}
Request headers interface with getter method
src/Hono.res:15:1
type req = { param: string => option<string>, query: string => option<string>, queries: string => option<array<string>>, header: string => option<string>, headers: reqHeaders, json: unit => unknown, text: unit => string, formData: unit => unknown, path: string, url: string, method: string,}
Request object containing all request-related data and methods
src/Hono.res:18:1
type c = { status: int => unit, header: (string, string) => unit, text: string => response, json: unknown => response, html: string => response, notFound: unit => response, redirect: (string, int) => response, req: req, get: string => option<string>, set: (string, string) => unit,}
Context object containing request data and response methods
src/Hono.res:33:1
handle
Section titled “handle”type handle = c => response
Synchronous route handler function type
src/Hono.res:47:1
handleAsync
Section titled “handleAsync”type handleAsync = c => promise<response>
Asynchronous route handler function type
src/Hono.res:50:1
useHandle
Section titled “useHandle”type useHandle = (c, unit => unit) => promise<unit>
Middleware handler function type
src/Hono.res:53:1
let get: (t, string, handle) => unit
Registers a GET route handler for the specified path
@param app - The Hono application instance
@param path - The route path pattern
@param handle - The synchronous handler function
src/Hono.res:61:5
getAsync
Section titled “getAsync”let getAsync: (t, string, handleAsync) => unit
Registers an asynchronous GET route handler for the specified path
@param app - The Hono application instance
@param path - The route path pattern
@param handle - The asynchronous handler function
src/Hono.res:69:5
let post: (t, string, handle) => unit
Registers a POST route handler for the specified path
@param app - The Hono application instance
@param path - The route path pattern
@param handle - The synchronous handler function
src/Hono.res:77:5
postAsync
Section titled “postAsync”let postAsync: (t, string, handleAsync) => unit
Registers an asynchronous POST route handler for the specified path
@param app - The Hono application instance
@param path - The route path pattern
@param handle - The asynchronous handler function
src/Hono.res:85:5
let put: (t, string, handle) => unit
Registers a PUT route handler for the specified path
@param app - The Hono application instance
@param path - The route path pattern
@param handle - The synchronous handler function
src/Hono.res:97:5
putAsync
Section titled “putAsync”let putAsync: (t, string, handleAsync) => unit
Registers an asynchronous PUT route handler for the specified path
@param app - The Hono application instance
@param path - The route path pattern
@param handle - The asynchronous handler function
src/Hono.res:105:5
delete
Section titled “delete”let delete: (t, string, handle) => unit
Registers a DELETE route handler for the specified path
@param app - The Hono application instance
@param path - The route path pattern
@param handle - The synchronous handler function
src/Hono.res:113:5
deleteAsync
Section titled “deleteAsync”let deleteAsync: (t, string, handleAsync) => unit
Registers an asynchronous DELETE route handler for the specified path
@param app - The Hono application instance
@param path - The route path pattern
@param handle - The asynchronous handler function
src/Hono.res:121:5
let use: (t, string, useHandle) => unit
Registers middleware for the specified path
@param app - The Hono application instance
@param path - The route path pattern
@param handle - The middleware handler function
src/Hono.res:133:5