1.0.0 • Published 8 years ago
koa-git v1.0.0
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