[wip] kefir cleanup

This commit is contained in:
2025-08-29 23:50:23 -04:00
parent 90be478e9a
commit 5e33e33cce
10 changed files with 2310 additions and 308 deletions

View File

@@ -1,33 +1,28 @@
import { cors } from "@elysiajs/cors";
import { staticPlugin } from "@elysiajs/static";
import { Elysia, env } from "elysia";
import api from "./api";
import staticFiles from "./static";
import * as log from "./logging";
const port = env.PORT || 5001;
const app = new Elysia()
new Elysia()
.use(
cors({
origin: ["http://localhost:3000", "https://games.drm.dev"],
origin: [
"http://localhost:3000", // dev
"https://games.drm.dev", // prod
],
})
)
// .onRequest(({ request }) => {
// console.log(request.method, request.url);
// })
.onError(({ error }) => {
console.error(error);
return error;
})
.onRequest(({ request }) => log.log(request))
.onError(({ error }) => log.err(error))
.get("/ping", () => "pong")
.use(api)
.get("/*", () => Bun.file("./public/index.html"))
.use(
staticPlugin({
assets: "public",
prefix: "/",
alwaysStatic: true,
})
)
.use(staticFiles)
.listen(port);
console.log("server started on", port);
log.log(`server started on ${port}`);