Files: d3edb71981df71ff6644088ad6b9a4fac8579848 / config.js
586 bytesRaw
1 | var http = require('http') |
2 | |
3 | module.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