Skip to content

Commit 3a1ebb2

Browse files
committed
updates docs and examples
1 parent c58f026 commit 3a1ebb2

13 files changed

+27819
-85
lines changed

README.md

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -10,25 +10,23 @@
1010
[![npm](https://img.shields.io/npm/dt/node-git-server.svg)]()
1111
[![npm](https://img.shields.io/npm/dm/node-git-server.svg)]()
1212

13-
This library makes it super easy to set up custom git push deploy logic.
14-
15-
# requirements
16-
17-
```
18-
- git (^ 2.7)
19-
```
20-
21-
# install
13+
# Install
2214

2315
```
2416
npm install node-git-server
2517
```
2618

27-
# example
19+
# Usage
2820

2921
```javascript
3022
const Server = require('node-git-server');
31-
const repos = Server('/tmp/repos');
23+
const repo = new Server(path.resolve(__dirname, 'tmp'), {
24+
autoCreate: true,
25+
authenticate: (type, repo, username, password, next) => {
26+
console.log(type, repo, username, password);
27+
next();
28+
}
29+
});
3230
const port = process.env.PORT || 7005;
3331

3432
repos.on('push', (push) => {
@@ -67,6 +65,8 @@ To http://localhost:7005/beep
6765
* [new branch] master -> master
6866
```
6967

68+
For more information please visit the [docs](http://www.gabrielcsapo.com/node-git-server/code/index.html)
69+
7070
# Philosophy
7171

7272
This library is aimed to have a zero dependency footprint. If you are reading this and you see dependencies, help to remove them 🐒.

docs/code/Git.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -553,7 +553,7 @@ <h4 class="name" id="Git"><span class="type-signature"></span>new Git<span class
553553
<br class="clear">
554554

555555
<footer>
556-
Documentation generated by <a href="https://github.com/jsdoc3/jsdoc">JSDoc 3.5.4</a> on Sat Sep 16 2017 19:42:32 GMT-0700 (PDT) using the <a href="https://github.com/clenemt/docdash">docdash</a> theme.
556+
Documentation generated by <a href="https://github.com/jsdoc3/jsdoc">JSDoc 3.5.5</a> on Thu Oct 12 2017 22:09:50 GMT-0700 (PDT) using the <a href="https://github.com/clenemt/docdash">docdash</a> theme.
557557
</footer>
558558

559559
<script>prettyPrint();</script>

docs/code/Service.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -171,7 +171,7 @@ <h3 class="subsection-title">Extends</h3>
171171
<br class="clear">
172172

173173
<footer>
174-
Documentation generated by <a href="https://github.com/jsdoc3/jsdoc">JSDoc 3.5.4</a> on Sat Sep 16 2017 19:42:32 GMT-0700 (PDT) using the <a href="https://github.com/clenemt/docdash">docdash</a> theme.
174+
Documentation generated by <a href="https://github.com/jsdoc3/jsdoc">JSDoc 3.5.5</a> on Thu Oct 12 2017 22:09:50 GMT-0700 (PDT) using the <a href="https://github.com/clenemt/docdash">docdash</a> theme.
175175
</footer>
176176

177177
<script>prettyPrint();</script>

docs/code/git.js.html

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -279,12 +279,12 @@ <h1 class="page-title">git.js</h1>
279279
function(req, res) {
280280
if (req.method !== 'GET') return false;
281281

282+
var self = this;
282283
var u = url.parse(req.url);
283284
var m = u.pathname.match(/\/(.+)\/info\/refs$/);
284285
if (!m) return false;
285286
if (/\.\./.test(m[1])) return false;
286287

287-
var self = this;
288288
var repo = m[1];
289289
var params = qs.parse(u.query);
290290
if (!params.service) {
@@ -463,7 +463,7 @@ <h1 class="page-title">git.js</h1>
463463
<br class="clear">
464464

465465
<footer>
466-
Documentation generated by <a href="https://github.com/jsdoc3/jsdoc">JSDoc 3.5.4</a> on Sat Sep 16 2017 19:42:32 GMT-0700 (PDT) using the <a href="https://github.com/clenemt/docdash">docdash</a> theme.
466+
Documentation generated by <a href="https://github.com/jsdoc3/jsdoc">JSDoc 3.5.5</a> on Thu Oct 12 2017 22:09:50 GMT-0700 (PDT) using the <a href="https://github.com/clenemt/docdash">docdash</a> theme.
467467
</footer>
468468

469469
<script>prettyPrint();</script>

docs/code/global.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -945,7 +945,7 @@ <h5>Parameters:</h5>
945945
<br class="clear">
946946

947947
<footer>
948-
Documentation generated by <a href="https://github.com/jsdoc3/jsdoc">JSDoc 3.5.4</a> on Sat Sep 16 2017 19:42:32 GMT-0700 (PDT) using the <a href="https://github.com/clenemt/docdash">docdash</a> theme.
948+
Documentation generated by <a href="https://github.com/jsdoc3/jsdoc">JSDoc 3.5.5</a> on Thu Oct 12 2017 22:09:50 GMT-0700 (PDT) using the <a href="https://github.com/clenemt/docdash">docdash</a> theme.
949949
</footer>
950950

951951
<script>prettyPrint();</script>

docs/code/index.html

Lines changed: 11 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -56,9 +56,14 @@ <h2><a href="index.html">Home</a></h2><h3>Classes</h3><ul><li><a href="Git.html"
5656
<a href="https://david-dm.org/gabrielcsapo/node-git-server#info=devDependencies"><img src="https://david-dm.org/gabrielcsapo/node-git-server/dev-status.svg" alt="devDependency Status"></a>
5757
<a href=""><img src="https://img.shields.io/npm/dt/node-git-server.svg" alt="npm"></a>
5858
<a href=""><img src="https://img.shields.io/npm/dm/node-git-server.svg" alt="npm"></a></p>
59-
<p>This library makes it super easy to set up custom git push deploy logic.</p>
60-
<h1>requirements</h1><pre class="prettyprint source"><code>- git (^ 2.7)</code></pre><h1>install</h1><pre class="prettyprint source"><code>npm install node-git-server</code></pre><h1>example</h1><pre class="prettyprint source lang-javascript"><code>const Server = require('node-git-server');
61-
const repos = Server('/tmp/repos');
59+
<h1>Install</h1><pre class="prettyprint source"><code>npm install node-git-server</code></pre><h1>Usage</h1><pre class="prettyprint source lang-javascript"><code>const Server = require('node-git-server');
60+
const repo = new Server(path.resolve(__dirname, 'tmp'), {
61+
autoCreate: true,
62+
authenticate: (type, repo, username, password, next) => {
63+
console.log(type, repo, username, password);
64+
next();
65+
}
66+
});
6267
const port = process.env.PORT || 7005;
6368

6469
repos.on('push', (push) => {
@@ -84,7 +89,8 @@ <h1>requirements</h1><pre class="prettyprint source"><code>- git (^ 2.7)</code><
8489
Writing objects: 100% (356/356), 46.20 KiB, done.
8590
Total 356 (delta 210), reused 355 (delta 210)
8691
To http://localhost:7005/beep
87-
* [new branch] master -> master</code></pre><h1>Philosophy</h1><p>This library is aimed to have a zero dependency footprint. If you are reading this and you see dependencies, help to remove them 🐒.</p>
92+
* [new branch] master -> master</code></pre><p>For more information please visit the <a href="http://www.gabrielcsapo.com/node-git-server/code/index.html">docs</a></p>
93+
<h1>Philosophy</h1><p>This library is aimed to have a zero dependency footprint. If you are reading this and you see dependencies, help to remove them 🐒.</p>
8894
<h1>Thanks</h1><p>This is a hard fork from <a href="https://github.com/substack/pushover">pushover</a>.</p></article>
8995
</section>
9096

@@ -98,7 +104,7 @@ <h1>Thanks</h1><p>This is a hard fork from <a href="https://github.com/substack/
98104
<br class="clear">
99105

100106
<footer>
101-
Documentation generated by <a href="https://github.com/jsdoc3/jsdoc">JSDoc 3.5.4</a> on Sat Sep 16 2017 19:42:32 GMT-0700 (PDT) using the <a href="https://github.com/clenemt/docdash">docdash</a> theme.
107+
Documentation generated by <a href="https://github.com/jsdoc3/jsdoc">JSDoc 3.5.5</a> on Thu Oct 12 2017 22:09:50 GMT-0700 (PDT) using the <a href="https://github.com/clenemt/docdash">docdash</a> theme.
102108
</footer>
103109

104110
<script>prettyPrint();</script>

docs/code/module-lib_util.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -907,7 +907,7 @@ <h5>Returns:</h5>
907907
<br class="clear">
908908

909909
<footer>
910-
Documentation generated by <a href="https://github.com/jsdoc3/jsdoc">JSDoc 3.5.4</a> on Sat Sep 16 2017 19:42:32 GMT-0700 (PDT) using the <a href="https://github.com/clenemt/docdash">docdash</a> theme.
910+
Documentation generated by <a href="https://github.com/jsdoc3/jsdoc">JSDoc 3.5.5</a> on Thu Oct 12 2017 22:09:50 GMT-0700 (PDT) using the <a href="https://github.com/clenemt/docdash">docdash</a> theme.
911911
</footer>
912912

913913
<script>prettyPrint();</script>

docs/code/service.js.html

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -86,6 +86,14 @@ <h1 class="page-title">service.js</h1>
8686
req.pipe(ts).pipe(buffered);
8787
}
8888

89+
if(req.headers["authorization"]) {
90+
const tokens = req.headers["authorization"].split(" ");
91+
if (tokens[0] === "Basic") {
92+
const splitHash = new Buffer(tokens[1], 'base64').toString('utf8').split(":");
93+
this.username = splitHash.shift();
94+
}
95+
}
96+
8997
ts.once('data', function(buf) {
9098
data += buf;
9199

@@ -202,7 +210,7 @@ <h1 class="page-title">service.js</h1>
202210
<br class="clear">
203211

204212
<footer>
205-
Documentation generated by <a href="https://github.com/jsdoc3/jsdoc">JSDoc 3.5.4</a> on Sat Sep 16 2017 19:42:32 GMT-0700 (PDT) using the <a href="https://github.com/clenemt/docdash">docdash</a> theme.
213+
Documentation generated by <a href="https://github.com/jsdoc3/jsdoc">JSDoc 3.5.5</a> on Thu Oct 12 2017 22:09:50 GMT-0700 (PDT) using the <a href="https://github.com/clenemt/docdash">docdash</a> theme.
206214
</footer>
207215

208216
<script>prettyPrint();</script>

docs/code/util.js.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -213,7 +213,7 @@ <h1 class="page-title">util.js</h1>
213213
<br class="clear">
214214

215215
<footer>
216-
Documentation generated by <a href="https://github.com/jsdoc3/jsdoc">JSDoc 3.5.4</a> on Sat Sep 16 2017 19:42:32 GMT-0700 (PDT) using the <a href="https://github.com/clenemt/docdash">docdash</a> theme.
216+
Documentation generated by <a href="https://github.com/jsdoc3/jsdoc">JSDoc 3.5.5</a> on Thu Oct 12 2017 22:09:50 GMT-0700 (PDT) using the <a href="https://github.com/clenemt/docdash">docdash</a> theme.
217217
</footer>
218218

219219
<script>prettyPrint();</script>

0 commit comments

Comments
 (0)