This repository has been archived by the owner on Oct 21, 2023. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 4
/
json.js.html
150 lines (146 loc) · 8.13 KB
/
json.js.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
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
<!DOCTYPE html>
<html lang="en">
<head>
<meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1" charset="utf-8">
<title>Waigo.js</title><!--[if IE]><link rel="shortcut icon" href="img/logo_32x32.ico" /><![endif]-->
<link rel="shortcut icon" href="/img/logo_114x114.png">
<meta name="msapplication-TileColor" content="#fff">
<meta name="msapplication-TileImage" content="/img/logo_144x144.png">
<link rel="stylesheet" media="screen" href="/style.css">
</head>
<body>
<header id="top" role="banner" class="navbar navbar-static-top">
<div class="container">
<div class="navbar-header">
<button type="button" data-toggle="collapse" data-target=".topmenu-navbar-collapse" class="navbar-toggle"><span class="sr-only">Toggle navigation</span><span class="icon-bar"></span><span class="icon-bar"></span><span class="icon-bar"></span></button><a href="/" class="navbar-brand">Waigo</a>
</div>
<div role="navigation" class="collapse navbar-collapse topmenu-navbar-collapse">
<ul class="nav navbar-nav">
<li><a id="guideNavItem" href="/">Guide</a></li>
<li><a href="/api">API</a></li>
</ul>
<ul class="nav navbar-nav navbar-right">
<li><a href="https://github.com/waigo/waigo">Github</a></li>
</ul>
</div>
</div>
</header>
<main id="content">
<div id="api">
<div class="container">
<div class="row">
<div role="complementary" class="col-md-3 waigo-api-index">
<ul class="nav hidden-sm hidden-xs">
<li><a href="../../index.html">Main</a></li>
<li><a href="../../config/base.js.html">config/base.js</a></li>
<li><a href="../../config/development.js.html">config/development.js</a></li>
<li><a href="../../config/index.js.html">config/index.js</a></li>
<li><a href="../../controllers/main.js.html">controllers/main.js</a></li>
<li><a href="../../routes.js.html">routes.js</a></li>
<li><a href="../../server.js.html">server.js</a></li>
<li><a href="../../support/db/mongoose.js.html">support/db/mongoose.js</a></li>
<li><a href="../../support/errors.js.html">support/errors.js</a></li>
<li><a href="../../support/logging/winston.js.html">support/logging/winston.js</a></li>
<li><a href="../../support/middleware/errorHandler.js.html">support/middleware/errorHandler.js</a></li>
<li><a href="../../support/middleware/outputFormats.js.html">support/middleware/outputFormats.js</a></li>
<li><a href="../../support/middleware/responseTime.js.html">support/middleware/responseTime.js</a></li>
<li><a href="../../support/middleware/sessions.js.html">support/middleware/sessions.js</a></li>
<li><a href="../../support/outputFormats/html.js.html">support/outputFormats/html.js</a></li>
<li class="active"><a href="../../support/outputFormats/json.js.html">support/outputFormats/json.js</a></li>
<li><a href="../../support/routeMapper.js.html">support/routeMapper.js</a></li>
<li><a href="../../support/session/store/mongo.js.html">support/session/store/mongo.js</a></li>
</ul>
<div class="visible-sm visible-xs">
<button type="button" data-toggle="collapse" data-target="#api-index-xs" class="btn btn-info">Show/hide API index</button>
<div id="api-index-xs">
<ul class="nav">
<li><a href="../../index.html">Main</a></li>
<li><a href="../../config/base.js.html">config/base.js</a></li>
<li><a href="../../config/development.js.html">config/development.js</a></li>
<li><a href="../../config/index.js.html">config/index.js</a></li>
<li><a href="../../controllers/main.js.html">controllers/main.js</a></li>
<li><a href="../../routes.js.html">routes.js</a></li>
<li><a href="../../server.js.html">server.js</a></li>
<li><a href="../../support/db/mongoose.js.html">support/db/mongoose.js</a></li>
<li><a href="../../support/errors.js.html">support/errors.js</a></li>
<li><a href="../../support/logging/winston.js.html">support/logging/winston.js</a></li>
<li><a href="../../support/middleware/errorHandler.js.html">support/middleware/errorHandler.js</a></li>
<li><a href="../../support/middleware/outputFormats.js.html">support/middleware/outputFormats.js</a></li>
<li><a href="../../support/middleware/responseTime.js.html">support/middleware/responseTime.js</a></li>
<li><a href="../../support/middleware/sessions.js.html">support/middleware/sessions.js</a></li>
<li><a href="../../support/outputFormats/html.js.html">support/outputFormats/html.js</a></li>
<li class="active"><a href="../../support/outputFormats/json.js.html">support/outputFormats/json.js</a></li>
<li><a href="../../support/routeMapper.js.html">support/routeMapper.js</a></li>
<li><a href="../../support/session/store/mongo.js.html">support/session/store/mongo.js</a></li>
</ul>
</div>
</div>
</div>
<div role="main" class="col-md-7 waigo-api-content">
<section id="create">
<h1>create</h1>
<div class="description"><p>Create an instance of this output format.</p> </div>
<h5 class="subheader"></h5>
<p>
<div class="label label-info radius ctx-type">method</div>
</p>
</section>
<table class="params table table-bordered table-striped">
<thead>
<tr>
<th style="width:20%">Option</th>
<th style="width:20%">Type</th>
<th>Description</th>
</tr>
</thead>
<tbody>
<tr>
<td class="name">{Object}</td>
<td class="type">config</td>
<td class="description">configuration for this output format.</td>
</tr>
</tbody>
</table>
<pre><code class="language-javascript">exports.create = function(config) {
return {
render: function*(view, locals) {
locals = locals || {};
if (!_.isPlainObject(locals)) {
throw new BaseError('Plain object required for JSON output format');
}
this.body = locals;
this.type = 'json';
}
};
};</code></pre>
</div>
<div class="col-md-2">
<div role="complementary" class="waigo-content-menu hidden-print">
<ul class="nav">
<li><a href="#create"><span>create()</span></a></li>
</ul>
</div>
</div>
</div>
</div>
</div>
</main>
<footer role="contentinfo"><p>Built by <a href="http://hiddentao.com">hiddentao</a></p>
<p>This page was <a href="https://github.com/waigo/waigojs.com-generator">generated</a> on Mon, 24 Feb 2014 16:28:18 GMT</p>
</footer>
<script type="text/javascript" src="/scripts.js"></script>
<script type="text/javascript">
var _paq = _paq || [];
_paq.push(["setDomains", ["*.waigojs.com","*.waigo.github.io"]]);
_paq.push(["trackPageView"]);
_paq.push(["enableLinkTracking"]);
(function() {
var u=(("https:" == document.location.protocol) ? "https" : "http") + "://piwik.hiddentao.com/";
_paq.push(["setTrackerUrl", u+"piwik.php"]);
_paq.push(["setSiteId", "3"]);
var d=document, g=d.createElement("script"), s=d.getElementsByTagName("script")[0]; g.type="text/javascript";
g.defer=true; g.async=true; g.src=u+"piwik.js"; s.parentNode.insertBefore(g,s);
})();
</script>
</body>
</html>