Commit 34b07459e5b69b2cfc44f79d97b19f3432c6191d
cache avatar name and image at application start
Ev Bogue committed on 11/1/2016, 4:48:56 AMParent: bcd9b355057bf21d39778b30190a37f049748d57
Files changed
index.js | changed |
index.js | ||
---|---|---|
@@ -5,22 +5,25 @@ | ||
5 | 5 … | var client = require('ssb-client') |
6 | 6 … | var md = require('ssb-markdown') |
7 | 7 … | var avatar = require('ssb-avatar') |
8 | 8 … | var mo = require('moment') |
9 | -var ref = require('ssb-ref') | |
9 … | +// var ref = require('ssb-ref') | |
10 | 10 … | |
11 | 11 … | var title = 'sdash' |
12 | 12 … | var me = '@8Qee0I/DwI5DHSCi3p5fsl6FyLGArrnDz3ox9qZr5Qc=.ed25519' |
13 | 13 … | var bloburl = 'https://evbogue.com/ws/blobs/get/' |
14 | 14 … | |
15 … | +client(function (err, sbot) { | |
16 … | + avatar(sbot, me, me, function (err, avatar){ | |
17 … | + if (err) throw err | |
18 … | + name = avatar.name | |
19 … | + image = avatar.image | |
20 … | + }) | |
21 … | +}) | |
22 … | + | |
15 | 23 … | http.createServer(function (req, res){ |
16 | 24 … | if (req.url === '/') { |
17 | 25 … | client(function (err, sbot) { |
18 | - avatar(sbot, me, me, function (err, avatar){ | |
19 | - if (err) throw err | |
20 | - name = avatar.name | |
21 | - image = avatar.image | |
22 | - }) | |
23 | 26 … | pull( |
24 | 27 … | sbot.query.read({query: [{$filter: { value: { author: me, content: {type: 'post'}}}}], limit: 1, reverse: true}), |
25 | 28 … | pull.drain(function (data) { |
26 | 29 … | post = data |
Built with git-ssb-web