forked from gabrielcsapo/node-git-server
-
Notifications
You must be signed in to change notification settings - Fork 0
/
.tryitout
42 lines (40 loc) · 1.32 KB
/
.tryitout
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
const { name, description } = require('./package.json');
module.exports = {
title: name,
nav: {
Source: 'https://github.com/gabrielcsapo/node-git-server',
Docs: './code/index.html'
},
body: `
<div style="width:80%;position: absolute;left: 50%;top: 50%;-webkit-transform: translate(-50%, -50%);transform: translate(-50%, -50%);">
<h3 class="text-center" style="font-weight: 100"> ${description} </h3>
<pre id="code" style="white-space: pre;text-align:left;width: auto;display:inline-block;">
const Server = require('node-git-server');
const repo = new Server(path.resolve(__dirname, 'tmp'), {
autoCreate: true,
authenticate: (type, repo, username, password, next) => {
console.log(type, repo, username, password);
next();
}
});
const port = process.env.PORT || 7005;
repos.listen(port, () => {
console.log(\`node-git-server running at http://localhost:{port}\`)
});
</pre>
</div>
`,
options: {
width: '80%'
},
footer: `
<div class="text-black">Made with ☕️ by <a href="http://www.gabrielcsapo.com">@gabrielcsapo</a></div>
`,
template: 'landing',
output: './docs',
externals: [
"./docs/krayon.css",
"./docs/krayon.min.js",
"./docs/main.js"
]
};