[prev in list] [next in list] [prev in thread] [next in thread]
List: kde-active
Subject: Re: Review Request 110752: Bodega-server: Add documentation support to bodega-server. Also add markd
From: "Aaron J. Seigo" <aseigo () kde ! org>
Date: 2013-06-02 13:36:00
Message-ID: 20130602133600.32034.14913 () vidsolbach ! de
[Download RAW message or body]
[Attachment #2 (multipart/alternative)]
> On May 31, 2013, 11:01 p.m., Aaron J. Seigo wrote:
> > server/routes.js, line 366
> > <http://git.reviewboard.kde.org/r/110752/diff/1/?file=147519#file147519line366>
> >
> > this means we can't have subdirs in the doc/ directory. perhaps better would be \
> > to call path.normalize .. sth like:
> > app.get('/api/(.*)', function(req, res) {
> > var filename = path.normalize(req.params[0]);
> >
> > this allows subdirs, and protects against things like '..' causing problems.
>
> Antonis Tsiapaliokas wrote:
> The above code makes a valid url something like localhost:3000/api/.json_api.. Is \
> that correct?
> In order the url to have the format localhost:3000/api/json_api it needs something \
> like
> app.get('/api/(*)', function(req,res) etc...
>
>
According to the Express documentation, it uses regular expressions so .* should work \
.. but whatever, as long as it works that's all that counts. If (*) works, go for it \
:)
- Aaron J.
-----------------------------------------------------------
This is an automatically generated e-mail. To reply, visit:
http://git.reviewboard.kde.org/r/110752/#review33542
-----------------------------------------------------------
On June 2, 2013, 9:48 a.m., Antonis Tsiapaliokas wrote:
>
> -----------------------------------------------------------
> This is an automatically generated e-mail. To reply, visit:
> http://git.reviewboard.kde.org/r/110752/
> -----------------------------------------------------------
>
> (Updated June 2, 2013, 9:48 a.m.)
>
>
> Review request for Bodega.
>
>
> Description
> -------
>
> Hello
>
> with that patch i am adding the following support to the bodega-server:
>
> 1) server/doc is the place which all of our documentaion lives.
> 2) The docs are accessible from /api/filename.E.x. for docs/README.markdown => \
> api/README
> If you all agree with that patch, i will push it to the branch which i am referring \
> above(kokeroulis/markdown/documentation)
> P.S. the two files are from bodega-server and bodega-client
>
>
> Diffs
> -----
>
> server/doc/index.markdown PRE-CREATION
> server/doc/json_api.markdown PRE-CREATION
> server/package.json 09f2527
> server/routes.js 95883a9
> server/test/api.js PRE-CREATION
> server/test/support/http.js b9e5cb3
>
> Diff: http://git.reviewboard.kde.org/r/110752/diff/
>
>
> Testing
> -------
>
>
> Thanks,
>
> Antonis Tsiapaliokas
>
>
[Attachment #5 (text/html)]
<html>
<body>
<div style="font-family: Verdana, Arial, Helvetica, Sans-Serif;">
<table bgcolor="#f9f3c9" width="100%" cellpadding="8" style="border: 1px #c9c399 \
solid;"> <tr>
<td>
This is an automatically generated e-mail. To reply, visit:
<a href="http://git.reviewboard.kde.org/r/110752/">http://git.reviewboard.kde.org/r/110752/</a>
</td>
</tr>
</table>
<br />
<blockquote style="margin-left: 1em; border-left: 2px solid #d0d0d0; padding-left: \
10px;"> <p style="margin-top: 0;">On May 31st, 2013, 11:01 p.m. UTC, <b>Aaron J. \
Seigo</b> wrote:</p> <blockquote style="margin-left: 1em; border-left: 2px solid \
#d0d0d0; padding-left: 10px;">
<table width="100%" border="0" bgcolor="white" style="border: 1px solid #C0C0C0; \
border-collapse: collapse; margin: 2px padding: 2px;"> <thead>
<tr>
<th colspan="4" bgcolor="#F0F0F0" style="border-bottom: 1px solid #C0C0C0; \
font-size: 9pt; padding: 4px 8px; text-align: left;"> <a \
href="http://git.reviewboard.kde.org/r/110752/diff/1/?file=147519#file147519line366" \
style="color: black; font-weight: bold; text-decoration: \
underline;">server/routes.js</a> <span style="font-weight: normal;">
(Diff revision 1)
</span>
</th>
</tr>
</thead>
<tbody style="background-color: #e4d9cb; padding: 4px 8px; text-align: center;">
<tr>
<td colspan="4"><pre style="font-size: 8pt; line-height: 140%; margin: 0; \
">function serverPath(path)</pre></td>
</tr>
</tbody>
<tbody>
<tr>
<th bgcolor="#b1ebb0" style="border-right: 1px solid #C0C0C0;" \
align="right"><font size="2"></font></th> <td bgcolor="#c5ffc4" width="50%"><pre \
style="font-size: 8pt; line-height: 140%; margin: 0; "></pre></td> <th \
bgcolor="#b1ebb0" style="border-left: 1px solid #C0C0C0; border-right: 1px solid \
#C0C0C0;" align="right"><font size="2">366</font></th> <td bgcolor="#c5ffc4" \
width="50%"><pre style="font-size: 8pt; line-height: 140%; margin: 0; "> <span \
class="kd">var</span> <span class="nx">filename</span> <span class="o">=</span> <span \
class="nx">path</span><span class="p">.</span><span class="nx">basename</span><span \
class="p">(</span><span class="nx">req</span><span class="p">.</span><span \
class="nx">url</span><span class="p">);</span></pre></td> </tr>
</tbody>
</table>
<pre style="white-space: pre-wrap; white-space: -moz-pre-wrap; white-space: \
-pre-wrap; white-space: -o-pre-wrap; word-wrap: break-word;">this means we can't \
have subdirs in the doc/ directory. perhaps better would be to call path.normalize .. \
sth like:
app.get('/api/(.*)', function(req, res) {
var filename = path.normalize(req.params[0]);
this allows subdirs, and protects against things like '..' causing \
problems.</pre> </blockquote>
<p>On June 2nd, 2013, 9:46 a.m. UTC, <b>Antonis Tsiapaliokas</b> wrote:</p>
<blockquote style="margin-left: 1em; border-left: 2px solid #d0d0d0; padding-left: \
10px;"> <pre style="white-space: pre-wrap; white-space: -moz-pre-wrap; white-space: \
-pre-wrap; white-space: -o-pre-wrap; word-wrap: break-word;">The above code makes a \
valid url something like localhost:3000/api/.json_api.. Is that correct?
In order the url to have the format localhost:3000/api/json_api it needs something \
like
app.get('/api/(*)', function(req,res) etc...
</pre>
</blockquote>
</blockquote>
<pre style="margin-left: 1em; white-space: pre-wrap; white-space: -moz-pre-wrap; \
white-space: -pre-wrap; white-space: -o-pre-wrap; word-wrap: break-word;">According \
to the Express documentation, it uses regular expressions so .* should work .. but \
whatever, as long as it works that's all that counts. If (*) works, go for it \
:)</pre> <br />
<p>- Aaron J.</p>
<br />
<p>On June 2nd, 2013, 9:48 a.m. UTC, Antonis Tsiapaliokas wrote:</p>
<table bgcolor="#fefadf" width="100%" cellspacing="0" cellpadding="8" \
style="background-image: \
url('http://git.reviewboard.kde.org/static/rb/images/review_request_box_top_bg.ab6f3b1072c9.png'); \
background-position: left top; background-repeat: repeat-x; border: 1px black \
solid;"> <tr>
<td>
<div>Review request for Bodega.</div>
<div>By Antonis Tsiapaliokas.</div>
<p style="color: grey;"><i>Updated June 2, 2013, 9:48 a.m.</i></p>
<h1 style="color: #575012; font-size: 10pt; margin-top: 1.5em;">Description </h1>
<table width="100%" bgcolor="#ffffff" cellspacing="0" cellpadding="10" \
style="border: 1px solid #b8b5a0"> <tr>
<td>
<pre style="margin: 0; padding: 0; white-space: pre-wrap; white-space: \
-moz-pre-wrap; white-space: -pre-wrap; white-space: -o-pre-wrap; word-wrap: \
break-word;">Hello
with that patch i am adding the following support to the bodega-server:
1) server/doc is the place which all of our documentaion lives.
2) The docs are accessible from /api/filename.E.x. for docs/README.markdown => \
api/README
If you all agree with that patch, i will push it to the branch which i am referring \
above(kokeroulis/markdown/documentation)
P.S. the two files are from bodega-server and bodega-client</pre>
</td>
</tr>
</table>
<h1 style="color: #575012; font-size: 10pt; margin-top: 1.5em;">Diffs</b> </h1>
<ul style="margin-left: 3em; padding-left: 0;">
<li>server/doc/index.markdown <span style="color: grey">(PRE-CREATION)</span></li>
<li>server/doc/json_api.markdown <span style="color: \
grey">(PRE-CREATION)</span></li>
<li>server/package.json <span style="color: grey">(09f2527)</span></li>
<li>server/routes.js <span style="color: grey">(95883a9)</span></li>
<li>server/test/api.js <span style="color: grey">(PRE-CREATION)</span></li>
<li>server/test/support/http.js <span style="color: grey">(b9e5cb3)</span></li>
</ul>
<p><a href="http://git.reviewboard.kde.org/r/110752/diff/" style="margin-left: \
3em;">View Diff</a></p>
</td>
</tr>
</table>
</div>
</body>
</html>
_______________________________________________
Active mailing list
Active@kde.org
https://mail.kde.org/mailman/listinfo/active
[prev in list] [next in list] [prev in thread] [next in thread]
Configure |
About |
News |
Add a list |
Sponsored by KoreLogic