git ssb

2+

ev / mvd



Tree: 340be07ddda4e511bfce40504bcda7b43381ed1b

Files: 340be07ddda4e511bfce40504bcda7b43381ed1b / 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