git ssb

0+

alanz / patchwork



forked from Matt McKegg / patchwork

Tree: 537b91ef87e630bc0e11a6cfe5ec069de206286c

Files: 537b91ef87e630bc0e11a6cfe5ec069de206286c / plugs / blob / sync / url.js

484 bytesRaw
1var nest = require('depnest')
2
3exports.needs = nest({
4 'config.sync.load': 'first'
5})
6
7exports.gives = nest('blob.sync.url')
8
9exports.create = function (api) {
10 return nest('blob.sync.url', function (link) {
11 var config = api.config.sync.load()
12 var prefix = config.blobsPrefix != null ? config.blobsPrefix : `http://localhost:${config.blobsPort}`
13 if (typeof link.link === 'string') {
14 link = link.link
15 }
16 return `${prefix}/${encodeURIComponent(link)}`
17 })
18}
19

Built with git-ssb-web