var koa = require('koa'); var app = koa(); var router = require('koa-router')(); var avatar = require('ssb-avatar'); var views = require('co-views'); var client = require('ssb-client') app.use(router.routes()) var render = views(__dirname, { ext: 'jade'}); var me = '@ya/sq19NPxRza5xtoqi9BilwLZ7HgQjG3QpcTRnGgWs=.ed25519' router.get('/', function *(next) { client(function (err,sbot) { if(err) { throw err; } avatar(sbot, me, me, function (err, avatar){ if (err) { throw err; } name = avatar.name; image = avatar.image; }) }) this.body = yield render('index', {title:'Porthole', name, image}) }) app.listen(3000);