I have an websocket
const port = 3333;
import { isValidApiKey } from "./functions/apikey";
type WebSocketData = {
apikey: string;
matchId: string;
};
const clients = new Set()
Bun.serve<WebSocketData>({
port: port,
async fetch(req: any, server: any) {
const url = new URL(req.url);
const apikey = url.searchParams.get("apikey");
const matchId = url.searchParams.get("matchId");
if (!apikey || !matchId) {
return new Response("No API key or matchId given", { status: 402 });
}
[...]
but for some reason the serve<WebSocketData> throws an error because it expected 2 type arguments. But when I add a second it just throws a different error and in the docs isn't anything about it