tracks lexicons and how many times they appeared on the jetstream

feat(client): use wss/https in prod

ptr.pet 8a4a46f2 a207054b

verified
Changed files
+6 -2
client
src
routes
+6 -2
client/src/routes/+page.svelte
···
const connectToStream = async () => {
if (isStreamOpen) return;
websocketStatus = "connecting";
-
websocket = new WebSocket(`ws://${PUBLIC_API_URL}/stream_events`);
+
websocket = new WebSocket(
+
`${dev ? "ws" : "wss"}://${PUBLIC_API_URL}/stream_events`,
+
);
websocket.binaryType = "arraybuffer";
websocket.onopen = () => {
console.log("ws opened");
···
try {
error = null;
-
const response = await fetch(`http://${PUBLIC_API_URL}/events`);
+
const response = await fetch(
+
`${dev ? "http" : "https"}://${PUBLIC_API_URL}/events`,
+
);
if (!response.ok) {
throw new Error(`HTTP error! status: ${response.status}`);
}