(action-for v)
Generates a form action based on http method
Generates a form action based on http method
(cookie-store)
(cookie-store options)
Creates an encrypted cookie storage engine. Accepts the following options:
:key - The secret key to encrypt the session cookie. Must be exactly 16 bytes If no key is provided then a random key will be generated. Note that in that case a server restart will invalidate all existing session cookies.
Creates an encrypted cookie storage engine. Accepts the following options: :key - The secret key to encrypt the session cookie. Must be exactly 16 bytes If no key is provided then a random key will be generated. Note that in that case a server restart will invalidate all existing session cookies.
(html options & content)
Render Clojure data structures to a string of HTML.
Render Clojure data structures to a string of HTML.
(html5 options & contents)
Create a HTML5 document with the supplied contents.
Create a HTML5 document with the supplied contents.
(include-css & styles)
Include a list of external stylesheet files.
Include a list of external stylesheet files.
(include-js & scripts)
Include a list of external javascript files.
Include a list of external javascript files.
(resource routes & ks)
Creates a set of seven functions that map to a conventional set of named functions. Generates routes that look like this:
[[:get '/resources resources/index] [:get '/resources/:id resources/show] [:get '/resources/fresh resources/fresh] ; this is 'fresh' not 'new' because new is reserved [:get '/resources/:id/edit resources/edit] [:post '/resources resources/create] [:put '/resources/:id resources/change] ; this is 'change' not 'update' because update is in clojure.core [:delete '/resources/:id resources/delete]]
Examples:
(resource :items) (resource :items :only [:create :delete]) (resource :items :sub-items :only [:index :create]) (resource :items :except [:index])
Creates a set of seven functions that map to a conventional set of named functions. Generates routes that look like this: [[:get '/resources resources/index] [:get '/resources/:id resources/show] [:get '/resources/fresh resources/fresh] ; this is 'fresh' not 'new' because new is reserved [:get '/resources/:id/edit resources/edit] [:post '/resources resources/create] [:put '/resources/:id resources/change] ; this is 'change' not 'update' because update is in clojure.core [:delete '/resources/:id resources/delete]] Examples: (resource :items) (resource :items :only [:create :delete]) (resource :items :sub-items :only [:index :create]) (resource :items :except [:index])
A default configuration for a browser-accessible website, based on current best practice.
A default configuration for a browser-accessible website, based on current best practice.
(url-for v)
Generates a url based on http method, route syntax and params
Generates a url based on http method, route syntax and params
(wrap-defaults handler config)
Wraps a handler in default Ring middleware, as specified by the supplied configuration map.
See: api-defaults site-defaults secure-api-defaults secure-site-defaults
Wraps a handler in default Ring middleware, as specified by the supplied configuration map. See: api-defaults site-defaults secure-api-defaults secure-site-defaults
(wrap-exceptions handler
&
[{:keys [app-namespaces skip-prone? print-stacktraces?]
:or {print-stacktraces? true}
:as opts}])
Let Prone handle exeptions instead of Ring. This way, instead of a centered stack trace, errors will give you a nice interactive page where you can browse data, filter the stack trace and generally get a good grip of what is happening.
Optionally, supply a opts map to specify namespaces to include, a predicate function to exclude certain requests from prone, and a boolean value to silence printing of exception stacktraces e.g.:
=> (wrap-exceptions handler {:app-namespaces ['your-ns-1 'my.ns.to-show] :skip-prone? (fn [req] (not-browser? req) :print-stacktraces? false})
Let Prone handle exeptions instead of Ring. This way, instead of a centered stack trace, errors will give you a nice interactive page where you can browse data, filter the stack trace and generally get a good grip of what is happening. Optionally, supply a opts map to specify namespaces to include, a predicate function to exclude certain requests from prone, and a boolean value to silence printing of exception stacktraces e.g.: => (wrap-exceptions handler {:app-namespaces ['your-ns-1 'my.ns.to-show] :skip-prone? (fn [req] (not-browser? req) :print-stacktraces? false})
(wrap-flash handler)
If a :flash key is set on the response by the handler, a :flash key with the same value will be set on the next request that shares the same session. This is useful for small messages that persist across redirects.
If a :flash key is set on the response by the handler, a :flash key with the same value will be set on the next request that shares the same session. This is useful for small messages that persist across redirects.
(wrap-resource handler root-path)
(wrap-resource handler root-path options)
Middleware that first checks to see whether the request map matches a static resource. If it does, the resource is returned in a response map, otherwise the request map is passed onto the handler. The root-path argument will be added to the beginning of the resource path.
Accepts the following options:
:loader - resolve the resource using this class loader :allow-symlinks? - allow symlinks that lead to paths outside the root classpath directories (defaults to false)
Middleware that first checks to see whether the request map matches a static resource. If it does, the resource is returned in a response map, otherwise the request map is passed onto the handler. The root-path argument will be added to the beginning of the resource path. Accepts the following options: :loader - resolve the resource using this class loader :allow-symlinks? - allow symlinks that lead to paths outside the root classpath directories (defaults to false)
cljdoc is a website building & hosting documentation for Clojure/Script libraries
× close