git ssb

1+

punkmonk.termux / mvd



forked from ev / mvd

Tree: a425ae10c31740a80df9cd0fb2c15de82b6bad4f

Files: a425ae10c31740a80df9cd0fb2c15de82b6bad4f / config.js

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

Built with git-ssb-web