Skip to content

Hono

src/Hono.res
type t

The main Hono application instance type

src/Hono.res:2:1


src/Hono.res
let make: unit => t

Creates a new Hono application instance

src/Hono.res:4:1


src/Hono.res
let make: unit => t

Creates a new Hono application instance

src/Hono.res:9:5


src/Hono.res
type response

HTTP response type

src/Hono.res:12:1


src/Hono.res
type reqHeaders = {get: string => option<string>}

Request headers interface with getter method

src/Hono.res:15:1


src/Hono.res
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


src/Hono.res
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


src/Hono.res
type handle = c => response

Synchronous route handler function type

src/Hono.res:47:1


src/Hono.res
type handleAsync = c => promise<response>

Asynchronous route handler function type

src/Hono.res:50:1


src/Hono.res
type useHandle = (c, unit => unit) => promise<unit>

Middleware handler function type

src/Hono.res:53:1


src/Hono.res
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


src/Hono.res
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


src/Hono.res
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


src/Hono.res
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


src/Hono.res
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


src/Hono.res
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


src/Hono.res
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


src/Hono.res
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


src/Hono.res
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