mirror of
https://github.com/qwerinope/qweribot.git
synced 2025-12-19 07:01:38 +01:00
fix bug with required https
This commit is contained in:
@@ -14,8 +14,8 @@ popover.textContent = 'Loading...'
|
||||
document.body.appendChild(popover);
|
||||
|
||||
const [badges, emotes] = await Promise.all([
|
||||
fetch(`http://${location.host}/chat/getBadges`).then(data => data.json()),
|
||||
fetch(`http://${location.host}/chat/getEmotes`).then(data => data.json())
|
||||
fetch(`${location.href}/getBadges`).then(data => data.json()),
|
||||
fetch(`${location.href}/getEmotes`).then(data => data.json())
|
||||
]);
|
||||
|
||||
await prefetchImages(Object.values(emotes));
|
||||
|
||||
@@ -5,7 +5,9 @@ import { type twitchEventData } from "web/chatWidget/websockettypes";
|
||||
import { parseMessage } from './createMessage';
|
||||
import { serverInstruction } from 'web/serverTypes';
|
||||
|
||||
const socket = new WebSocket(`ws://${location.host}`);
|
||||
const wsAddress = `ws${location.protocol === "https:" ? 's' : ''}://${location.host}`;
|
||||
|
||||
const socket = new WebSocket(wsAddress);
|
||||
|
||||
socket.onopen = () => {
|
||||
const instruction: serverInstruction = {
|
||||
|
||||
@@ -51,7 +51,7 @@ export default Bun.serve({
|
||||
ws.close();
|
||||
}
|
||||
},
|
||||
development: true,
|
||||
development: process.env.NODE_ENV === "development",
|
||||
error(error) {
|
||||
logger.err(`Error at chatwidget server: ${error}`);
|
||||
return new Response("Internal Server Error", { status: 500 })
|
||||
|
||||
Reference in New Issue
Block a user