koa-git

1.0.0 • Public • Published

koa-git

A git middleware for koa

USAGE EXAMPLE

First, you must have some repository somewhere or just create a new one.

git init --bare repo

Then, create a basic koa server with git middleware.

// server.js
 
const app = require('koa')();
const git = require('koa-git');
 
app.use(git({
  repo: 'repo',             // repo name that will be used on the URL
  path: __dirname + '/repo' // repo path on local directory
}));
 
app.listen(5000);

Run the server.

node server.js

Then, the bare repository that you created before ready to receive any push like this:

mkdir client
cd client
git init
echo 'README please ...' > README.md
git add .
git commit -m 'Initial commit'
git remote add origin http://localhost:5000/repo
git push -u origin master

Or, if it's not an empty repo, you can do clone or pull

git clone http://localhost:5000/repo

LICENSE

MIT

Dependencies (2)

Dev Dependencies (0)

    Package Sidebar

    Install

    npm i koa-git

    Weekly Downloads

    2

    Version

    1.0.0

    License

    MIT

    Last publish

    Collaborators

    • arch-mage