git ssb

0+

gb / ssb-porthole



Tree: 4e8da600acc3fc799b7e303c1b6c50bb67e7c45a

Files: 4e8da600acc3fc799b7e303c1b6c50bb67e7c45a / index.js

679 bytesRaw
1var koa = require('koa');
2var app = koa();
3var router = require('koa-router')();
4var avatar = require('ssb-avatar');
5var views = require('co-views');
6var client = require('ssb-client')
7
8app.use(router.routes())
9
10var render = views(__dirname, { ext: 'jade'});
11var me = '@ya/sq19NPxRza5xtoqi9BilwLZ7HgQjG3QpcTRnGgWs=.ed25519'
12
13router.get('/', function *(next) {
14 client(function (err,sbot) {
15 if(err) {
16 throw err;
17 }
18 avatar(sbot, me, me, function (err, avatar){
19 if (err) {
20 throw err;
21 }
22 name = avatar.name;
23 image = avatar.image;
24 })
25 })
26 this.body = yield render('index', {title:'Porthole', name, image})
27})
28
29app.listen(3000);
30

Built with git-ssb-web