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