# nodegit-http

> Read-only GitHub-like HTTP API atop nodegit using express.

Latest version **0.0.3** (published 2014-08-18) · MIT license · 0 weekly downloads

## Install

```sh
npm install nodegit-http
pnpm add nodegit-http
yarn add nodegit-http
bun add nodegit-http
```

Provides the command `nodegit-http`.

## Health

**Score 15/100 (F)** — status: abandoned.

Positive: no vulnerabilities.

Warnings: low downloads; no types; no esm support; pre 1.0.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 0.0.3 |
| Published | 2014-08-18 |
| First published | 2014-08-18 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 5 |
| Known vulnerabilities | 0 (+2 in 1 direct dependencies) |
| Install scripts | no |
| GitHub stars | 2 |
| Author | Deian Stefan |
| Maintainers | deian |
| Keywords | git, rest, express, http |

## Links

- npm: https://www.npmjs.com/package/nodegit-http
- Repository: git@github.com:deian/nodegit-http
- Homepage: https://github.com/deian/nodegit-http
- Issues: https://github.com/deian/nodegit-http/issues
- npm.io page: https://npm.io/package/nodegit-http

## Dependencies (5)

- [async](https://npm.io/package/async.md) ^0.9.0
- [debug](https://npm.io/package/debug.md) ^1.0.4
- [express](https://npm.io/package/express.md) ^4.8.4
- [nodegit](https://npm.io/package/nodegit.md) ^0.1.4
- [underscore](https://npm.io/package/underscore.md) ^1.6.0

## Alternatives

- [launchdarkly-js-client-sdk](https://npm.io/package/launchdarkly-js-client-sdk.md) — 2.5M weekly downloads
- [@elastic/elasticsearch](https://npm.io/package/@elastic/elasticsearch.md) — 2.1M weekly downloads
- [@c8y/client](https://npm.io/package/@c8y/client.md) — 15.3K weekly downloads
- [@signaldb/maverickjs](https://npm.io/package/@signaldb/maverickjs.md) — 1.7K weekly downloads
- [@bbc/http-transport-cache](https://npm.io/package/@bbc/http-transport-cache.md) — 1.2K weekly downloads

## Recent versions

- 0.0.3 (latest) — 2014-08-18
- 0.0.2 — 2014-08-18
- 0.0.1 — 2014-08-18

## README

Read-only GitHub-like HTTP API using [nodegit](https://github.com/nodegit/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.

### Install & Usage

```shell
npm install -g nodegit
npm install -g nodegit-http

nodegit-http [BASE_DIR [, PORT]]
```

Or from source:

```shell
git clone git@github.com: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
...
```

### API

The server exposes sevaral routes, similar to the [GitHub-API](https://developer.github.com/v3/git/). All responses are JSON.

* [`GET /repos/:repo/git/blobs/:sha`](https://developer.github.com/v3/git/blobs/#get-a-blob): get a blob.
* [`GET /repos/:repo/git/refs`](https://developer.github.com/v3/git/refs/#get-all-references): get all references.
* [`GET /repos/:repo/git/refs/:sub`](https://developer.github.com/v3/git/refs/#get-all-references): get all sub-namespace references.
* [`GET /repos/:repo/git/refs/*`](https://developer.github.com/v3/git/refs/#get-a-reference): get a reference.
* [`GET /repos/:repo/git/commits/:sha`](https://developer.github.com/v3/git/commits/#get-a-commit): get a commit.
* [`GET /repos/:repo/git/trees/:sha`](https://developer.github.com/v3/git/trees/#get-a-tree): get a tree.
* [`GET /repos/:repo/git/tags/:sha`](https://developer.github.com/v3/git/tags/#get-a-tag): get a tag.

---
_Source: https://npm.io/package/nodegit-http · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
