-
Notifications
You must be signed in to change notification settings - Fork 78
/
noir.server.html
25 lines (23 loc) · 4.84 KB
/
noir.server.html
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
<!DOCTYPE html>
<html><head><link href="css/default.css" rel="stylesheet" type="text/css"><script src="js/jquery.min.js" type="text/javascript"></script><script src="js/page_effects.js" type="text/javascript"></script><title>noir.server documentation</title></head><body><div id="header"><h1><a href="index.html">Noir 1.3.0-beta1 API documentation</a></h1></div><div class="sidebar" id="namespaces"><h3>Namespaces</h3><ul><li><a href="noir.cookies.html"><span>noir.cookies</span></a></li><li><a href="noir.core.html"><span>noir.core</span></a></li><li><a href="noir.options.html"><span>noir.options</span></a></li><li><a href="noir.request.html"><span>noir.request</span></a></li><li><a href="noir.response.html"><span>noir.response</span></a></li><li class="current"><a href="noir.server.html"><span>noir.server</span></a></li><li><a href="noir.server.handler.html"><span>noir.server.handler</span></a></li><li><a href="noir.session.html"><span>noir.session</span></a></li><li><a href="noir.statuses.html"><span>noir.statuses</span></a></li><li><a href="noir.util.crypt.html"><span>noir.util.crypt</span></a></li><li><a href="noir.util.gae.html"><span>noir.util.gae</span></a></li><li><a href="noir.util.test.html"><span>noir.util.test</span></a></li><li><a href="noir.validation.html"><span>noir.validation</span></a></li></ul></div><div class="sidebar" id="vars"><h3>Public Vars</h3><ul><li><a href="noir.server.html#var-add-middleware"><span>add-middleware</span></a></li><li><a href="noir.server.html#var-gen-handler"><span>gen-handler</span></a></li><li><a href="noir.server.html#var-load-views"><span>load-views</span></a></li><li><a href="noir.server.html#var-load-views-ns"><span>load-views-ns</span></a></li><li><a href="noir.server.html#var-restart"><span>restart</span></a></li><li><a href="noir.server.html#var-start"><span>start</span></a></li><li><a href="noir.server.html#var-stop"><span>stop</span></a></li><li><a href="noir.server.html#var-wrap-route"><span>wrap-route</span></a></li></ul></div><div class="namespace-docs" id="content"><h2>noir.server documentation</h2><pre class="doc">A collection of functions to handle Noir's server and add middleware to the stack.
</pre><div class="public" id="var-add-middleware"><h3>add-middleware</h3><div class="usage"><code>(add-middleware func & args)</code></div><pre class="doc">Add a middleware function to the noir server. Func is a standard ring middleware
function, which will be passed the handler. Any extra args to be applied should be
supplied along with the function.</pre></div><div class="public" id="var-gen-handler"><h3>gen-handler</h3><div class="usage"><code>(gen-handler & [opts])</code></div><pre class="doc">Get a full Noir request handler for use with plugins like lein-ring or lein-beanstalk.
If used in a definition, this must come after views have been loaded to ensure that the
routes have already been added to the route table.</pre></div><div class="public" id="var-load-views"><h3>load-views</h3><div class="usage"><code>(load-views & dirs)</code></div><pre class="doc">Require all the namespaces in the given dir so that the pages are loaded
by the server.</pre></div><div class="public" id="var-load-views-ns"><h3>load-views-ns</h3><div class="usage"><code>(load-views-ns & ns-syms)</code></div><pre class="doc">Require all the namespaces prefixed by the namespace symbol given so that the pages
are loaded by the server.</pre></div><div class="public" id="var-restart"><h3>restart</h3><div class="usage"><code>(restart server)</code></div><pre class="doc">Restart a noir server
</pre></div><div class="public" id="var-start"><h3>start</h3><div class="usage"><code>(start port & [opts])</code></div><pre class="doc">Create a noir server bound to the specified port with a map of options and return it.
The available options are:
:mode - either :dev or :prod
:ns - the root namepace of your project
:jetty-options - any extra options you want to send to jetty like :ssl?
:base-url - the root url to prepend to generated links and resources
:resource-options - a map of options for the resources route (:root or :mime-types)
:session-store - an alternate store for session handling
:session-cookie-attrs - custom session cookie attributes</pre></div><div class="public" id="var-stop"><h3>stop</h3><div class="usage"><code>(stop server)</code></div><pre class="doc">Stop a noir server
</pre></div><div class="public" id="var-wrap-route"><h3>wrap-route</h3><div class="usage"><code>(wrap-route route middleware & args)</code></div><pre class="doc">Add a middleware function to a specific route. Route is a standard route you would
use for defpage, func is a ring middleware function, and args are any additional args
to pass to the middleware function. You can wrap the resources and catch-all routes by
supplying the routes :resources and :catch-all respectively:
(wrap-route :resources some-caching-middleware)</pre></div></div></body></html>