Middleware for web requests. Could be that we move this to interceptors later.
Middleware for web requests. Could be that we move this to interceptors later.
Default middleware for http servers
Default middleware for http servers
(kebab-case-query h)
Middleware that converts any query params to kebab-case, to make them more idiomatic.
Middleware that converts any query params to kebab-case, to make them more idiomatic.
(log-request h)
Just logs the request, for monitoring or debugging purposes.
Just logs the request, for monitoring or debugging purposes.
(passthrough-middleware h)
No-op middleware, just passes the request to the parent handler.
No-op middleware, just passes the request to the parent handler.
(post-events h)
Middleware that posts any events that are found in the response map
Middleware that posts any events that are found in the response map
(replace-body-org-id h)
Since the org-id
can be a cuid or a display id, this interceptor replaces the
value in the request body with the one in the path params.
Since the `org-id` can be a cuid or a display id, this interceptor replaces the value in the request body with the one in the path params.
(resolve-org-id h resolver)
Replaces the org id when a display id is given. How resolving happens is delegated to a resolver fn that takes the req and the org display id. Since there is no sure way to distinguish between a display id and a cuid, the resolver should be able to handle both situations.
Replaces the org id when a display id is given. How resolving happens is delegated to a resolver fn that takes the req and the org display id. Since there is no sure way to distinguish between a display id and a cuid, the resolver should be able to handle both situations.
(stringify-body h)
Since the raw body could be read more than once (security, content negotiation...), this interceptor replaces it with a string that can be read multiple times. This should only be used for requests that have reasonably small bodies! In other cases, the body could be written to a temp file.
Since the raw body could be read more than once (security, content negotiation...), this interceptor replaces it with a string that can be read multiple times. This should only be used for requests that have reasonably small bodies! In other cases, the body could be written to a temp file.
cljdoc builds & hosts documentation for Clojure/Script libraries
Ctrl+k | Jump to recent docs |
← | Move to previous article |
→ | Move to next article |
Ctrl+/ | Jump to the search field |