git ssb

2+

ev / mvd



Tree: a91aacd99613bd8ba1f3551725dd523017b34d18

Files: a91aacd99613bd8ba1f3551725dd523017b34d18 / config.js

586 bytesRaw
1var http = require('http')
2
3module.exports = function () {
4 var host = window.location.origin
5
6 if (localStorage[host])
7 var config = JSON.parse(localStorage[host])
8 else
9 http.get(host + '/get-config', function (res) {
10 res.on('data', function (data, remote) {
11 var config = data
12 localStorage[host] = config
13 location.reload()
14 })
15 })
16
17 config.blobsUrl = host + '/blobs/get/'
18 config.emojiUrl = host + '/img/emoji/'
19
20 if (config.ws.remote)
21 config.remote = config.ws.remote
22 else
23 config.remote = config.address
24
25 return config
26}
27

Built with git-ssb-web