Ecosyste.ms: Awesome

An open API service indexing awesome lists of open source software.

Awesome Lists | Featured Topics | Projects

https://github.com/tootallnate/node-gitweb

Directly invoke and serve GitWeb through NodeJS.
https://github.com/tootallnate/node-gitweb

Last synced: 4 days ago
JSON representation

Directly invoke and serve GitWeb through NodeJS.

Awesome Lists containing this project

README

        

node-gitweb
===========
### Directly invoke and serve [GitWeb][] through [NodeJS][Node].

This module uses [node-cgi][] to invoke the `gitweb.cgi` perl file.

![](http://f.cl.ly/items/422e0m0u472w3L2W1y3g/Screen%20Shot%202012-01-29%20at%202.14.39%20PM.png)

Example
-------

``` js
var http = require('http');
var gitweb = require('gitweb');

http.createServer( gitweb('/') ).listen(80);
```

That's a very simple example.

The first argument is the `mountPoint`. This is the HTTP url in which
GitWeb will be served from. It MUST start and end with a `/` slash character.

It's recommended to also pass a second argument, a `config` Object,
that can take the following parameters:

* __projectroot__ - The root directory where git repos will be listed from. Default: `process.env.HOME`.
* __homelink__ - The text of the link to the GitWeb root in the top-left corner of each page. Default: the value of __projectroot__.
* __sitename__ - This value will be prefixed onto the `` on each page. Default: `GitWeb powered by Node`.
* __version__ - The version value of the internally used `gitweb.cgi` file. This can really just be any arbitrary String. Default: `1.7.1`.
* __max_depth__ - The number of directories deep from _projectroot_ that GitWeb should look for git repos. Default: `100`.
* __snapshot_default__ - The "snapshot" links are _off_ by default. If you would like to re-enable them, set this value to something like `tgz` or `zip`.

[Node]: http://nodejs.org
[node-cgi]: https://github.com/TooTallNate/node-cgi
[GitWeb]: https://git.wiki.kernel.org/index.php/Gitweb