git ssb

3+

ev / decent



Tree: b773afd37fa9e0e53c2eb8cd47b15c682a315f79

Files: b773afd37fa9e0e53c2eb8cd47b15c682a315f79 / config.js

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

Built with git-ssb-web