Directly invoke and serve GitWeb through NodeJS.
JavaScript Perl Shell
Latest commit b2aecea Feb 21, 2013 @TooTallNate v0.1.4
Failed to load latest commit information.
git @ 828ea97
static Update the gitweb files from the git repo. Jan 29, 2012
.gitignore Add a .gitignore for npm 1.0 May 18, 2011
.gitmodules Initial commit. Not quite working yet... Feb 16, 2011
.npmignore Better screenshot again. Jan 29, 2012
gitweb.cgi Update the gitweb files from the git repo. Jan 29, 2012
gitweb.js Update reported GitWeb version. Jan 29, 2012
gitweb_config.perl Fix nasty error message from being displayed on each request when no … May 18, 2011
package.json v0.1.4 Feb 21, 2013
test.js ... May 18, 2011 Remove TODO, not gonna do that… Jan 29, 2012


Directly invoke and serve GitWeb through NodeJS.

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


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 <title> 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.