bitque/jirs-client/static/index.js

14 lines
643 B
JavaScript
Raw Normal View History

2020-04-06 08:38:08 +02:00
const getWsHostName = () => process.env.JIRS_SERVER_BIND === "0.0.0.0" ? 'localhost' : process.env.JIRS_SERVER_BIND;
const getProtocol = () => window.location.protocol.replace(/^http/, 'ws');
2020-06-10 22:11:51 +02:00
const wsUrl = () => `${getProtocol()}//${getWsHostName()}:${process.env.JIRS_SERVER_PORT}/ws/`;
2020-04-06 08:38:08 +02:00
import("/jirs.js").then(async module => {
2020-10-18 10:35:41 +02:00
// window.module = module;
await module.default();
2020-06-10 22:11:51 +02:00
const host_url = `${location.protocol}//${process.env.JIRS_SERVER_BIND}:${process.env.JIRS_SERVER_PORT}`;
module.render(host_url, wsUrl());
2020-10-18 10:35:41 +02:00
document.querySelector('main').className = '';
document.querySelector('.spinner').remove();
2020-03-30 08:16:26 +02:00
});