Files
minabot/src/index.ts
syntaxbullet d3cbf2f7dc feat(auth): add Discord OAuth sign-in and user timezones
Add persistent user and session storage, protected profile requests, and React sign-in controls. Capture and preserve each user's timezone, and load development and production configuration before migrations and server startup.
2026-09-04 08:29:48 +02:00

23 lines
541 B
TypeScript

import { db } from "./db";
import { createApi } from "./api";
import { readAuthConfig } from "./auth/config";
import index from "./index.html";
const app = createApi(db, readAuthConfig());
const server = Bun.serve({
hostname: "127.0.0.1",
port: Number(process.env.PORT ?? 3000),
routes: {
"/api": req => app.fetch(req),
"/api/*": req => app.fetch(req),
"/*": index,
},
development: process.env.NODE_ENV !== "production" && {
hmr: true,
console: true,
},
});
console.log(`Server running at ${server.url}`);