Skip to content

Commit

Permalink
Database module deprecated. Docs updated.
Browse files Browse the repository at this point in the history
  • Loading branch information
igoramadas committed Jul 28, 2017
1 parent a4fadb5 commit c85cb76
Show file tree
Hide file tree
Showing 42 changed files with 758 additions and 2,202 deletions.
19 changes: 6 additions & 13 deletions docs/annotated/index.html
Expand Up @@ -29,11 +29,6 @@
</a>


<a class="source" href="lib.database.html">
lib/database.coffee
</a>


<a class="source" href="lib.events.html">
lib/events.coffee
</a>
Expand Down Expand Up @@ -74,11 +69,6 @@
</a>


<a class="source" href="plugins.database-mongodb.index.html">
plugins/database-mongodb/index.coffee
</a>


<a class="source" href="plugins.downloader.index.html">
plugins/downloader/index.coffee
</a>
Expand Down Expand Up @@ -139,6 +129,11 @@
</a>


<a class="source" href="plugins.mongodb.index.html">
plugins/mongodb/index.coffee
</a>


<a class="source" href="plugins.sockets.index.html">
plugins/sockets/index.coffee
</a>
Expand Down Expand Up @@ -220,7 +215,6 @@ <h2 id="expresser">EXPRESSER</h2>
utils: <span class="hljs-built_in">require</span> <span class="hljs-string">"./lib/utils.coffee"</span>
events: <span class="hljs-built_in">require</span> <span class="hljs-string">"./lib/events.coffee"</span>
logger: <span class="hljs-built_in">require</span> <span class="hljs-string">"./lib/logger.coffee"</span>
database: <span class="hljs-built_in">require</span> <span class="hljs-string">"./lib/database.coffee"</span>
app: <span class="hljs-built_in">require</span> <span class="hljs-string">"./lib/app.coffee"</span></pre></div></div>

</li>
Expand Down Expand Up @@ -364,8 +358,7 @@ <h2 id="expresser">EXPRESSER</h2>
<div class="pilwrap ">
<a class="pilcrow" href="#section-12">&#182;</a>
</div>
<p>Get options accordingly to plugin name. For example the expresser-database-mongodb
should have its options set under settings.database.mongodb.</p>
<p>Get options accordingly to plugin name.</p>

</div>

Expand Down
51 changes: 30 additions & 21 deletions docs/annotated/lib.app.html
Expand Up @@ -29,11 +29,6 @@
</a>


<a class="source" href="lib.database.html">
lib/database.coffee
</a>


<a class="source" href="lib.events.html">
lib/events.coffee
</a>
Expand Down Expand Up @@ -74,11 +69,6 @@
</a>


<a class="source" href="plugins.database-mongodb.index.html">
plugins/database-mongodb/index.coffee
</a>


<a class="source" href="plugins.downloader.index.html">
plugins/downloader/index.coffee
</a>
Expand Down Expand Up @@ -139,6 +129,11 @@
</a>


<a class="source" href="plugins.mongodb.index.html">
plugins/mongodb/index.coffee
</a>


<a class="source" href="plugins.sockets.index.html">
plugins/sockets/index.coffee
</a>
Expand Down Expand Up @@ -818,14 +813,23 @@ <h2 id="helper-and-utils">HELPER AND UTILS</h2>
<div class="pilwrap ">
<a class="pilcrow" href="#section-40">&#182;</a>
</div>
<p>Helper to log all requests when debug is true.</p>
<p>Return a collection with all routes registered on the server.
@param {Boolean} simple If true, returns only an array the route strings.
@return {Array} Collection with routes (as object or as string).</p>

</div>

<div class="content"><div class='highlight'><pre><span class="hljs-function"> <span class="hljs-title">requestLogger</span> = <span class="hljs-params">(req, res, next)</span> -&gt;</span>
ip = utils.browser.getClientIP req
method = req.method
url = req.url</pre></div></div>
<div class="content"><div class='highlight'><pre> getRoutes: <span class="hljs-function"><span class="hljs-params">(simple = <span class="hljs-literal">false</span>)</span> =&gt;</span>
result = []

<span class="hljs-keyword">for</span> r <span class="hljs-keyword">in</span> @server._router.stack
<span class="hljs-keyword">if</span> r.route?.path? <span class="hljs-keyword">and</span> r.route.path <span class="hljs-keyword">isnt</span> <span class="hljs-string">""</span>
<span class="hljs-keyword">if</span> simple
result.push r.route.path
<span class="hljs-keyword">else</span>
result.push {route: r.route.path, methods: lodash.keys(r.route.methods)}

<span class="hljs-keyword">return</span> result</pre></div></div>

</li>

Expand All @@ -836,16 +840,20 @@ <h2 id="helper-and-utils">HELPER AND UTILS</h2>
<div class="pilwrap ">
<a class="pilcrow" href="#section-41">&#182;</a>
</div>
<p>Check if request flash is present before logging.</p>
<p>Helper to log all requests when debug is true.</p>

</div>

<div class="content"><div class='highlight'><pre> <span class="hljs-keyword">if</span> req.flash? <span class="hljs-keyword">and</span> lodash.isFunction req.flash
<span class="hljs-built_in">console</span>.log <span class="hljs-string">"Request from <span class="hljs-subst">#{ip}</span>"</span>, method, url, req.flash()
<span class="hljs-keyword">else</span>
<span class="hljs-built_in">console</span>.log <span class="hljs-string">"Request from <span class="hljs-subst">#{ip}</span>"</span>, method, url
<div class="content"><div class='highlight'><pre><span class="hljs-function"> <span class="hljs-title">requestLogger</span> = <span class="hljs-params">(req, res, next)</span> -&gt;</span>
ip = utils.browser.getClientIP req
method = req.method
url = req.url

<span class="hljs-built_in">console</span>.log <span class="hljs-string">"Request from <span class="hljs-subst">#{ip}</span>"</span>, method, url

next() <span class="hljs-keyword">if</span> next?

next() <span class="hljs-keyword">if</span> next?</pre></div></div>
<span class="hljs-keyword">return</span> url</pre></div></div>

</li>

Expand Down Expand Up @@ -1087,6 +1095,7 @@ <h2 id="helper-and-utils">HELPER AND UTILS</h2>
</div>

<div class="content"><div class='highlight'><pre> status = status <span class="hljs-keyword">or</span> error?.statusCode <span class="hljs-keyword">or</span> <span class="hljs-number">500</span>
error = error.message + <span class="hljs-string">" "</span> + error.stack <span class="hljs-keyword">if</span> lodash.isError error
error = JSON.stringify error <span class="hljs-keyword">if</span> <span class="hljs-keyword">not</span> lodash.isString error</pre></div></div>

</li>
Expand Down

0 comments on commit c85cb76

Please sign in to comment.