git ssb

1+

punkmonk.termux / mvd



forked from ev / mvd

Tree: 3ac3f63409b2f6e177034de5ad8483d25749626a

Files: 3ac3f63409b2f6e177034de5ad8483d25749626a / mvd / config.js

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

Built with git-ssb-web