example.js |
|
Generated by CoffeeScript 1.6.1 |
var GitServer, repoOne, repoTwo, repos, _git;
GitServer = require('./host.js');
|
¶ Create example repo 1This repo does NOT allow Anonymous access |
repoOne = {
name: 'stackdot',
anonRead: false,
users: [
{
user: {
username: 'demo',
password: 'demo'
},
permissions: ['R', 'W']
}
]
};
|
¶ Create example repo 2This repo allows Anonymous reading (fetch,clone) access |
repoTwo = {
name: 'anon',
anonRead: true,
users: [
{
user: {
username: 'demo2',
password: 'demo2'
},
permissions: ['R', 'W']
}
],
onSuccessful: {
fetch: function() {
return console.log('Successful fetch on "anon" repo');
},
push: function() {
return console.log('Success push on "anon" repo');
}
}
};
repos = [repoOne, repoTwo];
|
¶ Create the GitServer objectWe are passing in |
_git = new GitServer(repos, true, '/tmp/repos', 7000);
|