Browse Source

fixed bug related to running behind a proxy

master
mortie 7 years ago
parent
commit
527846c629
2 changed files with 7 additions and 4 deletions
  1. 1
    1
      package.json
  2. 6
    3
      web/script.js

+ 1
- 1
package.json View File

@@ -1,6 +1,6 @@
{
"name": "pipic",
"version": "1.0.0",
"version": "1.0.1",
"description": "Pipic is software for making slideshows. The idea is that you have one server, running a pipic server, and have as many clients as necessary which just display the website hosted by the pipic server.",
"main": "server.js",
"dependencies": {

+ 6
- 3
web/script.js View File

@@ -36,10 +36,13 @@ function update(name) {
}

function reload() {
message("Server down, waiting");
message("Connection to server lost.");
var i = setInterval(() => {
fetch("/")
.then(() => {
.then(res => {
if (res.status !== 200)
return;

history.replaceState({}, "", "/");
location.reload();
})
@@ -61,7 +64,7 @@ function await() {
}
await();
})
.catch(err => { console.error(err); await(); });
.catch(err => { console.error(err); reload(); });
}

await();

Loading…
Cancel
Save