CrossClj

0.1.2 docs

SourceDocs



RECENT
    VARS
    ->Endpoint
    ->Methods
    coerce-handler
    compile-result
    create-default-handler
    create-resource-handler
    get-match
    get-router
    group-keys
    http-methods
    map->Endpoint
    map->Methods
    ring-handler
    router
    routes

    « Index of all namespaces of this project

    (->Endpoint data handler path method middleware)
    Positional factory function for class reitit.ring.Endpoint.
    
    (->Methods get head post put delete connect options trace patch)
    Positional factory function for class reitit.ring.Methods.
    
    (coerce-handler [path data] {:keys [expand], :as opts})
    (compile-result [path data] opts)
    (create-default-handler)(create-default-handler {:keys [not-found method-not-allowed not-acceptable]})
    A default ring handler that can handle the following cases,
    configured via options:
    
    | key                    | description |
    | -----------------------|-------------|
    | :not-found           | 404, no routes matches
    | :method-not-accepted | 405, no method matches
    | :not-acceptable      | 406, handler returned nil
    (create-resource-handler)(create-resource-handler {:keys [parameter root path loader allow-symlinks? index-files paths], :or {parameter (keyword ""), root "public", index-files ["index.html"], paths (constantly nil)}})
    A ring handler for serving classpath resources, configured via options:
    
    | key              | description |
    | -----------------|-------------|
    | :parameter       | optional name of the wildcard parameter, defaults to unnamed keyword :
    | :root            | optional resource root, defaults to "public"
    | :path            | optional path to mount the handler to. Works only if mounted outside of a router.
    | :loader          | optional class loader to resolve the resources
    | :index-files     | optional vector of index-files to look in a resource directory, defaults to ["index.html"]
    (get-match request)
    (get-router handler)
    Private
    (group-keys data)
    (map->Endpoint m__7585__auto__)
    Factory function for class reitit.ring.Endpoint, taking a map of keywords to field values.
    
    (map->Methods m__7585__auto__)
    Factory function for class reitit.ring.Methods, taking a map of keywords to field values.
    
    (ring-handler router)(ring-handler router default-handler)
    Creates a ring-handler out of a ring-router.
    Supports both 1 (sync) and 3 (async) arities.
    Optionally takes a ring-handler which is called
    in no route matches.
    (router data)(router data opts)
    Creates a [[reitit.core/Router]] from raw route data and optionally an options map with
    support for http-methods and Middleware. See [docs](https://metosin.github.io/reitit/)
    for details.
    
    Example:
    
        (router
          ["/api" {:middleware [wrap-format wrap-oauth2]}
            ["/users" {:get get-user
                         :post update-user
                         :delete {:middleware [wrap-delete]
                                 :handler delete-user}}]])
    
    See router options from [[reitit.core/router]] and [[reitit.middleware/router]].
    (routes & handlers)
    Create a ring handler by combining several handlers into one.