example.coffee |
|
Require the GitServer module |
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 : ->
console.log 'Successful fetch on "anon" repo'
push : ->
console.log 'Success push on "anon" repo'
|
Put these into arrays |
repos = [ repoOne, repoTwo ]
|
¶ Create the GitServer objectWe are passing in |
_git = new GitServer repos, true, '/tmp/repos', 7000
|