add endpoint for oembed; restyle gifv; skeleton for websocket

This commit is contained in:
waveringana 2024-05-10 02:43:52 -04:00
parent ec3597e474
commit e799724b3b
9 changed files with 312 additions and 209 deletions

20
app/lib/ws.ts Normal file
View file

@ -0,0 +1,20 @@
import WebSocket from "ws";
const wsPort = normalizePort(process.env.EBWSPORT || "3001");
function normalizePort(val: string) {
const port = parseInt(val, 10);
if (isNaN(port)) {
return parseInt(val);
}
if (port >= 0) {
return port;
}
}
const wss = new WebSocket.Server({port: wsPort});
export { wss };