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.
This commit is contained in:
12
src/index.ts
12
src/index.ts
@@ -1,15 +1,9 @@
|
||||
import { Hono } from "hono";
|
||||
import { sql } from "drizzle-orm";
|
||||
import { db } from "./db";
|
||||
import { createApi } from "./api";
|
||||
import { readAuthConfig } from "./auth/config";
|
||||
import index from "./index.html";
|
||||
|
||||
const app = new Hono();
|
||||
|
||||
app.get("/api/health", c => {
|
||||
db.get(sql`SELECT 1`);
|
||||
return c.json({ status: "ok" });
|
||||
});
|
||||
app.notFound(c => c.json({ error: "Not found" }, 404));
|
||||
const app = createApi(db, readAuthConfig());
|
||||
|
||||
const server = Bun.serve({
|
||||
hostname: "127.0.0.1",
|
||||
|
||||
Reference in New Issue
Block a user