git ssb

0+

alanz / patchwork



forked from Matt McKegg / patchwork

Tree: c1bbd85b688758bb943822743d5ad75bf3761ab1

Files: c1bbd85b688758bb943822743d5ad75bf3761ab1 / plugs / blob / sync / url.js

492 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 (link && typeof link.link === 'string') {
14 link = link.link
15 }
16 return `${prefix}/${encodeURIComponent(link)}`
17 })
18}
19

Built with git-ssb-web