(->reitit spec)
Adapts given moclojer endpoints to reitit's data based routes, while parsing request data types throughout the way. Supports both HTTP endpoints and WebSocket endpoints.
Adapts given moclojer endpoints to reitit's data based routes, while parsing request data types throughout the way. Supports both HTTP endpoints and WebSocket endpoints.
(build-body response request)
Builds the body from the response.
Builds the body from the response.
(create-swagger-route)
Create Swagger documentation endpoint
Create Swagger documentation endpoint
(create-ws-handler path on-connect on-message)
Create WebSocket handler function with connection and message handling
Create WebSocket handler function with connection and message handling
(enrich-external-body external-body request)
Enriches the external body with a resolved path.
Enriches the external body with a resolved path.
(generate-method method)
Adapts given method
to a normalized string version of itself.
Adapts given `method` to a normalized string version of itself.
(generic-reitit-handler response webhook-config)
Builds a reitit handler that responds with pre-defined response
.
Since we also support webhooks
, given webhook-config
is used
when necessary in together with the response
.
Builds a reitit handler that responds with pre-defined `response`. Since we also support `webhooks`, given `webhook-config` is used when necessary in together with the `response`.
(get-response-body response request)
Gets the correct response body (processing external-body if necessary)
Gets the correct response body (processing external-body if necessary)
(handle-ws-connect channel connect-config request-params)
Handle WebSocket connection
Handle WebSocket connection
(make-path-parameters path & [gen?])
Based on path
's declared type, provides a placeholder that can be
used later on by reitit to understand the param's data type.
Based on `path`'s declared type, provides a placeholder that can be used later on by reitit to understand the param's data type.
(merge-routes routes [route-name route-definition])
Merge route definitions with the same path
Merge route definitions with the same path
(mock-response-body-request ?body parameters)
Given a body
, generates a request based on the used variables.
Given a `body`, generates a request based on the used variables.
(parse-json-safely content)
Tries to parse a JSON, returning the original content in case of error
Tries to parse a JSON, returning the original content in case of error
(process-http-routes spec)
Process HTTP endpoints and return route configurations
Process HTTP endpoints and return route configurations
(process-ws-message channel message pattern-configs request-params)
Process WebSocket message based on pattern matching
Process WebSocket message based on pattern matching
(process-ws-routes spec)
Process WebSocket endpoints and return route configurations
Process WebSocket endpoints and return route configurations
(render-template template request)
Renders given template
, using request
's data.
Renders given `template`, using `request`'s data.
(webhook-condition condition request)
Checks if
condition and return boolean value, default is true when condition is empty
Checks `if` condition and return boolean value, default is true when condition is empty
(ws-send! channel message)
Sends a message to a WebSocket connection
Sends a message to a WebSocket connection
cljdoc is a website building & hosting documentation for Clojure/Script libraries
× close