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.
(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.
(wrap-api-handler handler)
a wrapper for restful API calls
a wrapper for restful API calls
(wrap-stateful-api-handler handler)
a wrapper for JSON API calls from pinkgorilla notebook
a wrapper for JSON API calls from pinkgorilla notebook
cljdoc is a website building & hosting documentation for Clojure/Script libraries
× close