No matching definitions.

httpd/handler

src/httpd/handler.tur

typed request handlers via the Handler typeclass.

Since: U2 (Handler typeclass)

defmacro

serve

(serve [port type-name])

start a pool-dispatched server whose handler is the `Handler`

defmacro

serve-pool

(serve-pool [port type-name size])

like `serve` but with an explicit worker-pool size,

defmacro

serve-spawn

(serve-spawn [port type-name])

like `serve` but using the thread-per-connection

defmacro

serve-conn

(serve-conn [port type-name])

start a pool-dispatched, upgrade-aware server whose handler

defmacro

serve-pool-conn

(serve-pool-conn [port type-name size])

like `serve-conn` but with an explicit worker-pool size,

defmacro

req-decode

(req-decode [req type-name])

parse a request body as JSON and decode it into `T` via the

defn

json-ok

(json-ok [^EncodeJson T x : T] :)

a 200 response whose body is `x` encoded as JSON, with

(json-ok (make-struct EchoResp "hi" 2))
defn

json-resp

(json-resp [^EncodeJson T status : int x : T] :)

like `json-ok` but with an explicit status code (e.g. 201,

(json-resp 201 (make-struct Created (.id row)))
defmacro

with-json-body

(with-json-body [req type-name f])

decode the request body into `T` and, on success, call

Internal definitions
__cstr-free-- release a malloc'd JSON fragment returned by `encode-json`.