git ssb

3+

ev / sdash



Tree: 746f5afe179f874dc5f6c5608629c805307ecf1c

Files: 746f5afe179f874dc5f6c5608629c805307ecf1c / invite.js

912 bytesRaw
1var fs = require('fs')
2var http = require('http')
3var h = require('hyperscript')
4var pull = require('pull-stream')
5var client = require('ssb-client')
6var mo = require('moment')
7
8var title = 'ssb-genvite'
9var liteURL = 'http://ssb.evbogue.com/'
10var opts = {"modern":true,}
11var lite;
12
13http.createServer(function (req, res){
14 if (req.url === '/') {
15 client(function (err, sbot) {
16 sbot.invite.create(opts, function (err, invite) {
17 if(err) throw err
18 lite = invite
19 gotInvite()
20 })
21 })
22 function gotInvite() {
23 res.end(
24 h('html',
25 h('head',
26 h('title', title),
27 h('style', fs.readFileSync('style.css', 'utf8'))
28 ),
29 h('body',
30 h('div.msg',
31 h('p', {innerHTML: '<a href="' + liteURL + '#' + lite + '">'+ liteURL + '#' + lite + '</a>'})
32 )
33 )
34 ).outerHTML)
35 }
36 }
37}).listen(1777)
38

Built with git-ssb-web