Read-only GitHub-like HTTP API using nodegit.
While there are a few similar node projects out there, the goal of this project is to keep the implementation as simple as possible. As a result, there are no users and thus no authentication.
npm install -g nodegit
npm install -g nodegit-http
nodegit-http [BASE_DIR [, PORT]]
Or from source:
git clone [email protected]:deian/nodegit-http.git
cd nodegit-http && npm install && npm --BASE_DIR=/var/repos/ --PORT=1337 start
nodegit-http serves any git repositories from the current directory, or that specified by the environment variable BASE_DIR
. The assumed directory structure is as follows:
BASE_DIR/repo.git
BASE_DIR/myotherrepo.git
...
The server exposes sevaral routes, similar to the GitHub-API. All responses are JSON.
GET /repos/:repo/git/blobs/:sha
: get a blob.GET /repos/:repo/git/refs
: get all references.GET /repos/:repo/git/refs/:sub
: get all sub-namespace references.GET /repos/:repo/git/refs/*
: get a reference.GET /repos/:repo/git/commits/:sha
: get a commit.GET /repos/:repo/git/trees/:sha
: get a tree.GET /repos/:repo/git/tags/:sha
: get a tag.