node-git-server
node-git-server copied to clipboard
Added the option to specify a host
trafficstars
Ref: #100
For now this PR is not merge yet, so an alternative is doing that (at least until this PR merged);
// import http server
const http = require('http');
//... all other configs
const repos = new Git(join(__dirname, '../repo'), {
autoCreate: true,
});
//... all other configs
// replace this
// repos.listen(port, "0.0.0.0", () => {
// console.log(`node-git-server running at http://localhost:${port}`);
// });
// with this
repos.server = http.createServer((req, res) => {
repos.handle(req, res);
});
repos.server.listen(port, "0.0.0.0", () => {
console.log(`node-git-server running at http://localhost:${port}`);
});