var fs = require('fs') var http = require('http') var h = require('hyperscript') var pull = require('pull-stream') var client = require('ssb-client') var mo = require('moment') var title = 'ssb-genvite' var liteURL = 'http://ssb.evbogue.com/' var opts = {"modern":true,} var lite; http.createServer(function (req, res){ if (req.url === '/') { client(function (err, sbot) { sbot.invite.create(opts, function (err, invite) { if(err) throw err lite = invite gotInvite() }) }) function gotInvite() { res.end( h('html', h('head', h('title', title), h('style', fs.readFileSync('style.css', 'utf8')) ), h('body', h('div.msg', h('p', {innerHTML: ''+ liteURL + '#' + lite + ''}) ) ) ).outerHTML) } } }).listen(1777)