INNER CODE UNIT · TypeScript
onListening
homarr-labs/homarr · apps/websocket/src/main.ts:20
const onListening = () => {
wss.off("error", onError);
logger.info("✅ WebSocket Server listening on ws://localhost:3001");
resolve();
};
const onError = (error: Error) => {
wss.off("listening", onListening);
reject(error);
};
wss.once("listening", onListening);
wss.once("error", onError);
});
const handler = applyWSSHandler({
wss,
router: appRouter,
// ignore error on next line because the createContext must be set with this name