gabrielcsapo / node-git-server

🎡 A configurable git server written in Node.js
https://gabrielcsapo.github.io/node-git-server
MIT License
253 stars 73 forks source link

Provided example script hangs. #90

Closed x90slide closed 2 years ago

x90slide commented 2 years ago

` Git = require('node-git-server').Git join = require('path').join

const port = !process.env.PORT || isNaN(process.env.PORT) ? 7005 : parseInt(process.env.PORT);

const repos = new Git( join(__dirname, '../repo'), { autoCreate: true, } );

repos.on('push', push => { console.log(push ${push.repo}/${push.commit} ( ${push.branch} )); push.accept(); });

repos.on("fetch", fetch => { console.log(fetch ${fetch.commit}); fetch.accept(); });

repos.listen(port, () => { console.log(node-git-server running at http://localhost:${port}); });`

Running this code with 'node index.js' hangs immediately and the server does not start.

stevesouth commented 2 years ago

I think this is just a documentation issue which i've fixed here. https://github.com/gabrielcsapo/node-git-server/pull/103

gabrielcsapo commented 2 years ago

This should be fixed in 1.0.0 and the exact PR was https://github.com/gabrielcsapo/node-git-server/pull/88 that fixed it. Options was being assumed to exist and the type was not being set by default.