Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

Added the option to specify a host #105

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open

Conversation

h110m
Copy link

@h110m h110m commented Aug 16, 2022

Ref: #100

@agutoli
Copy link

agutoli commented Sep 8, 2022

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}`);
});

# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants