Skip to content

Commit

Permalink
improves and adds config for gateway deployment
Browse files Browse the repository at this point in the history
  • Loading branch information
significance committed Aug 7, 2020
1 parent 56d32a9 commit 35e934b
Show file tree
Hide file tree
Showing 2 changed files with 20 additions and 6 deletions.
6 changes: 6 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -62,3 +62,9 @@ server {
}
}
```

### Deploy

```
curl -vv -F file=@dist-html-only/index.html http://localhost:8083/files
```
20 changes: 14 additions & 6 deletions dist/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -5,12 +5,17 @@
<script defer src="qrcode.min.js"></script>
<script defer src="index.js"></script>
<script>
var host = "http://localhost:8080/"; //with trailing slash
var gatewayAddress = "http://localhost:8083"; //no trailing slash



let prod = true;

if(prod){
var gatewayAddress = "http://localhost:8083"; //no trailing slash
var host = gatewayAddress + "/files/"; //with trailing slash and files/ if on bee
}else{
var gatewayAddress = "http://localhost:8083"; //no trailing slash
var host = "http://localhost:8080/"; //with trailing slash

}

Expand Down Expand Up @@ -124,10 +129,13 @@
}

function makeManifestLink(linkHash, sharedPrivateKey) {
// var bzzPart = linkHash !== "/" ? "bzz" + linkHash + "/" : "";
// let bzzPart = 'files';
log('makeManifestLink', {linkHash, sharedPrivateKey});
return host + "?" + sharedPrivateKey;
if(prod){
var reference = window.location.href.split('/')[4];
}else{
var reference = '';
}
log('makeManifestLink', {reference, linkHash, sharedPrivateKey});
return host + reference + "?" + sharedPrivateKey;
}

function getLinkHash(pathname) {
Expand Down

0 comments on commit 35e934b

Please sign in to comment.