Files: fbfff87a5febf165ddb5240685ba7433b7083770 / config.js
780 bytesRaw
1 | var http = require('http') |
2 | |
3 | module.exports = function () { |
4 | //var host = window.location.origin |
5 | //var host = 'http://localhost:8989' |
6 | var host = 'http://evbogue.com: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 | |
38 |
Built with git-ssb-web