Liking cljdoc? Tell your friends :D

webly.web.middleware

a middleware takes a handler, and wraps a middleware around it. It is handler transformation, not routing related.

a middleware takes a handler, and wraps a middleware around it.
It is handler transformation, not routing related.
raw docstring

allow-cross-originclj

(allow-cross-origin handler)
(allow-cross-origin handler allowed-origins)

Middleware function to allow cross origin requests from browsers. When a browser attempts to call an API from a different domain, it makes an OPTIONS request first to see the server's cross origin policy. So, in this method we return that when an OPTIONs request is made. Additionally, for non OPTIONS requests, we need to just returm the 'Access-Control-Allow-Origin' header or else the browser won't read the data properly. The above notes are all based on how Chrome works.

Middleware function to allow cross origin requests from browsers.
When a browser attempts to call an API from a different domain, it makes an OPTIONS request first to see the server's
cross origin policy.  So, in this method we return that when an OPTIONs request is made.
Additionally, for non OPTIONS requests, we need to just returm the 'Access-Control-Allow-Origin' header or else
the browser won't read the data properly.
The above notes are all based on how Chrome works. 
sourceraw docstring

wrap-api-handlerclj

(wrap-api-handler handler)

a wrapper for restful API calls

a wrapper for restful API calls
sourceraw docstring

wrap-stateful-api-handlerclj

(wrap-stateful-api-handler handler)

a wrapper for JSON API calls from pinkgorilla notebook

a wrapper for JSON API calls
from pinkgorilla notebook
sourceraw docstring

wrap-weblyclj

(wrap-webly handler)
source

cljdoc is a website building & hosting documentation for Clojure/Script libraries

× close