import * as u from "./utils.mjs"; import * as hero from "./hero.mjs"; const name = "papo"; const newConnection = (req, ws) => { console.log({ ws, req }); // ws.on("error", console.error); // ws.on("message", x => console.log(x.toString())); // ws.send("hello from the server"); }; const routes = [ [ "WEBSOCKET", "/api/socket", newConnection ], ]; export const app = async (socket, pipe) => await hero.buildServer({ name, routes, socket, pipe, }).start();