git ssb

2+

mixmix / ticktack



Tree: f736acde0d02447833cfd0c3a021d2d560e5c9a6

Files: f736acde0d02447833cfd0c3a021d2d560e5c9a6 / blob / sync / url.js

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

Built with git-ssb-web