login page

This commit is contained in:
Matteo Rosati
2026-01-24 22:20:26 +01:00
parent f2deb162df
commit d00b48a197
10 changed files with 997 additions and 41 deletions

34
server.ts Normal file
View File

@@ -0,0 +1,34 @@
import { Hono } from "hono";
import { upgradeWebSocket, websocket } from "hono/bun";
const app = new Hono();
app.get("/", async (c) => {
return c.json({
message: "ok",
});
});
app.get(
"/ws",
upgradeWebSocket((c) => {
return {
onOpen(event, ws) {
console.log("Server: Connection opened");
ws.send("Hello!");
},
onClose: () => {
console.log("Server: Connection closed");
},
onMessage: (ev) => {
console.log(ev.data);
},
};
}),
);
export default {
port: Bun.env.SERVER_PORT,
fetch: app.fetch,
websocket,
};