Skip to content
Snippets Groups Projects
Commit 4282765a authored by Bartek Wrona's avatar Bartek Wrona Committed by Bartek Wrona
Browse files

proxy-observer/index.html: HiveChain api endpoint is evaluated from runtime...

proxy-observer/index.html: HiveChain api endpoint is evaluated from runtime document.location.hostname
parent 6179e87a
No related branches found
No related tags found
1 merge request!1Add alternate testnet network with initminer access to the examples to improve user experience with testing
......@@ -38,6 +38,11 @@
import WorkerBee from "../../dist/bundle/index.js";
import { OperationVisitor } from "@hive-staging/wax";
const hostname = document.location.hostname;
const used_protocol = document.location.protocol;
console.log(`Received protocol: ${used_protocol}, hostname: ${hostname}`);
const startBtn = document.getElementById("start");
const logger = document.getElementById("log");
const log = (what, error = false) => {
......@@ -186,7 +191,7 @@
bot = new WorkerBee({
postingKey: document.getElementById('key').value,
chainOptions: {
apiEndpoint: 'http://localhost:3000/',
apiEndpoint: used_protocol + '//' + hostname + ':3000',
chainId: '18dcf0a285365fc58b71f18b3d3fec954aa0c141c44e4e5cb4cf777b9eab274e'
}
});
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment