Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 5 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -74,6 +74,7 @@ The git server can be configured using a parameter object on creation:

```js
{
ip: '127.0.0.1',
port: 8080,
baseURL: '/git',
repoDir: 'repos',
Expand All @@ -82,7 +83,10 @@ The git server can be configured using a parameter object on creation:
}
```

By default the server will be started on port 8080, using `/git` as the base URL, `repos` as the subfolder name of your repositories and an empty user list. All of the subfolders of `repos` will be used as repositories.
By default the server will be started on address 127.0.0.1:8080, using `/git` as the base URL, `repos` as the subfolder name of your repositories and an empty user list. All of the subfolders of `repos` will be used as repositories.

### ip
The `ip` configuration parameter is used to determine the correct ip, in case multiple network adapters (and therefore ips) are associated with the host machine.

### baseURL

Expand Down
6 changes: 4 additions & 2 deletions git-server-windows.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ var child_process = require('child_process');
var spawn = child_process.spawn;
var zlib = require('zlib')

var ip;
var port;
var baseURL;
var repoDir;
Expand All @@ -19,6 +20,7 @@ exports.User = function(config) {

exports.server = function(config) {
var config = config || {};
ip = config.ip || "127.0.0.1";
port = config.port || 8080;
baseURL = config.baseURL || "/git";
repoDir = config.repoDir || "repos";
Expand All @@ -35,8 +37,8 @@ exports.server = function(config) {
app.post(baseURL + '/:reponame/git-receive-pack', checkAuth, postReceivePack);
app.post(baseURL + '/:reponame/git-upload-pack', postUploadPack);

app.listen(port, () => {
console.log('Git Server listening on port ' + port + ' ...');
app.listen(port, ip, () => {
console.log('Git Server listening on ' + ip + ':' + port);
});
};

Expand Down