git ssb

10+

Matt McKegg / patchwork



Tree: 45a926949dc7ae72b90ae8fcc4bd39a796355669

Files: 45a926949dc7ae72b90ae8fcc4bd39a796355669 / 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