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

{ {
"name": "pipic", "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.", "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", "main": "server.js",
"dependencies": { "dependencies": {

+ 6
- 3
web/script.js View File

} }


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

history.replaceState({}, "", "/"); history.replaceState({}, "", "/");
location.reload(); location.reload();
}) })
} }
await(); await();
}) })
.catch(err => { console.error(err); await(); });
.catch(err => { console.error(err); reload(); });
} }


await(); await();

Loading…
Cancel
Save