Skip to content

Instantly share code, notes, and snippets.

@TooTallNate
Created January 19, 2015 23:00
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save TooTallNate/b974f92a7e49b7911cc8 to your computer and use it in GitHub Desktop.
Save TooTallNate/b974f92a7e49b7911cc8 to your computer and use it in GitHub Desktop.
Runs the `git http-backend` CGI server via `node-cgi`
var cgi = require('cgi');
var http = require('http');
// See: http://git-scm.com/docs/git-http-backend
http.createServer( cgi('git', {
args: [ 'http-backend' ],
env: {
'GIT_PROJECT_ROOT': process.env.HOME,
'GIT_HTTP_EXPORT_ALL': '1'
}
}) ).listen(8080);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment