130 lines
4.0 KiB
HTML
130 lines
4.0 KiB
HTML
<!DOCTYPE html>
|
|
|
|
<html>
|
|
<head>
|
|
<title>config.js</title>
|
|
<meta http-equiv="content-type" content="text/html; charset=UTF-8">
|
|
<meta name="viewport" content="width=device-width, target-densitydpi=160dpi, initial-scale=1.0; maximum-scale=1.0; user-scalable=0;">
|
|
<link rel="stylesheet" media="all" href="docco.css" />
|
|
</head>
|
|
<body>
|
|
<div id="container">
|
|
<div id="background"></div>
|
|
|
|
<ul id="jump_to">
|
|
<li>
|
|
<a class="large" href="javascript:void(0);">Jump To …</a>
|
|
<a class="small" href="javascript:void(0);">+</a>
|
|
<div id="jump_wrapper">
|
|
<div id="jump_page">
|
|
|
|
|
|
<a class="source" href="config.html">
|
|
config.js
|
|
</a>
|
|
|
|
|
|
<a class="source" href="middleware.html">
|
|
middleware.js
|
|
</a>
|
|
|
|
|
|
<a class="source" href="seed.html">
|
|
seed.js
|
|
</a>
|
|
|
|
|
|
<a class="source" href="server.html">
|
|
server.js
|
|
</a>
|
|
|
|
|
|
<a class="source" href="utils.html">
|
|
utils.js
|
|
</a>
|
|
|
|
</div>
|
|
</li>
|
|
</ul>
|
|
|
|
<ul class="sections">
|
|
|
|
<li id="title">
|
|
<div class="annotation">
|
|
<h1>config.js</h1>
|
|
</div>
|
|
</li>
|
|
|
|
|
|
|
|
<li id="section-1">
|
|
<div class="annotation">
|
|
|
|
<div class="pilwrap ">
|
|
<a class="pilcrow" href="#section-1">¶</a>
|
|
</div>
|
|
|
|
</div>
|
|
|
|
<div class="content"><div class='highlight'><pre><span class="comment">/* Load nconf and define default configuration values if config.json or ENV vars are not found*/</span>
|
|
|
|
|
|
<span class="keyword">var</span> conf = require(<span class="string">"nconf"</span>);
|
|
<span class="keyword">var</span> path = require(<span class="string">"path"</span>);
|
|
|
|
conf.argv()
|
|
.env()</pre></div></div>
|
|
|
|
</li>
|
|
|
|
|
|
<li id="section-2">
|
|
<div class="annotation">
|
|
|
|
<div class="pilwrap ">
|
|
<a class="pilcrow" href="#section-2">¶</a>
|
|
</div>
|
|
<p>.file('defaults', path.join(path.resolve(__dirname, '../config.json.example')))</p>
|
|
|
|
</div>
|
|
|
|
<div class="content"><div class='highlight'><pre> .file(<span class="string">'user'</span>, path.join(path.resolve(__dirname, <span class="string">'../config.json'</span>)));
|
|
|
|
<span class="comment">/*
|
|
var agent;
|
|
if (process.env.NODE_ENV === 'development') {</pre></div></div>
|
|
|
|
</li>
|
|
|
|
|
|
<li id="section-3">
|
|
<div class="annotation">
|
|
|
|
<div class="pilwrap ">
|
|
<a class="pilcrow" href="#section-3">¶</a>
|
|
</div>
|
|
<p>Follow these instructions for profiling / debugging leaks
|
|
<em> <a href="https://developers.google.com/chrome-developer-tools/docs/heap-profiling">https://developers.google.com/chrome-developer-tools/docs/heap-profiling</a>
|
|
</em> <a href="https://developers.google.com/chrome-developer-tools/docs/memory-analysis-101">https://developers.google.com/chrome-developer-tools/docs/memory-analysis-101</a></p>
|
|
|
|
</div>
|
|
|
|
<div class="content"><div class='highlight'><pre> agent = require('webkit-devtools-agent');
|
|
console.log("To debug memory leaks:" +
|
|
"\n\t(1) Run `kill -SIGUSR2 " + process.pid + "`" +
|
|
"\n\t(2) open http://c4milo.github.com/node-webkit-agent/21.0.1180.57/inspector.html?host=localhost:1337&page=0");
|
|
}
|
|
*/
|
|
|
|
|
|
if (conf.get('NODE_ENV') === "development") {
|
|
Error.stackTraceLimit = Infinity;
|
|
}</pre></div></div>
|
|
|
|
</li>
|
|
|
|
</ul>
|
|
</div>
|
|
</body>
|
|
</html>
|