Files: 49b9d75d1238284ccbdc490e247b0123993db7c6 / server.js
662 bytesRaw
1 | |
2 | ':' //; exec "$(command -v nodejs || command -v node)" "$0" "$@" |
3 | // http://unix.stackexchange.com/questions/65235/universal-node-js-shebang |
4 | // vi: ft=javascript |
5 | |
6 | var appName = process.env.ssb_appname || |
7 | require('child_process').spawnSync('git', ['config', 'ssb.appname'], |
8 | {encoding: 'utf8'}).stdout.trim() |
9 | var ssbConfig = require('ssb-config/inject')(appName) |
10 | var keys = require('ssb-keys') |
11 | .loadOrCreateSync(require('path').join(ssbConfig.path, 'secret')) |
12 | |
13 | require('ssb-client')(keys, ssbConfig, function (err, sbot) { |
14 | if (err) throw err |
15 | require('.')(sbot, process.argv[3], function (err) { |
16 | sbot.close() |
17 | if (err) throw err |
18 | }) |
19 | }) |
20 |
Built with git-ssb-web