Files: bdc777360c48b4ead49e30a0a5932c35621c0c90 / config.js
510 bytesRaw
1 | var http = require('http') |
2 | |
3 | module.exports = function () { |
4 | var host = window.location.origin |
5 | |
6 | http.get(host + '/get-config', function (res) { |
7 | res.on('data', function (data, remote) { |
8 | config = data |
9 | localStorage[host] = config |
10 | }) |
11 | }) |
12 | |
13 | var config = JSON.parse(localStorage[host]) |
14 | |
15 | config.blobsUrl = host + '/blobs/get/' |
16 | config.emojiUrl = host + '/img/emoji/' |
17 | |
18 | if (config.ws.remote) |
19 | config.remote = config.ws.remote |
20 | else |
21 | config.remote = config.address |
22 | |
23 | return config |
24 | } |
25 |
Built with git-ssb-web