refactor(api): ♻️ Serve frontend from static files instead of proxying another process

This commit is contained in:
Jesse Wierzbinski 2025-03-27 18:51:22 +01:00
parent 5f8c57b3e1
commit 58b4d7454f
No known key found for this signature in database
8 changed files with 133 additions and 107 deletions

View file

@ -1,5 +1,6 @@
import { cwd } from "node:process";
import { z } from "@hono/zod-openapi";
import { type BunFile, file } from "bun";
import { type BunFile, env, file } from "bun";
import ISO6391 from "iso-639-1";
import { types as mimeTypes } from "mime-types";
import { generateVAPIDKeys } from "web-push";
@ -400,7 +401,7 @@ export const ConfigSchema = z
}),
frontend: z.strictObject({
enabled: z.boolean().default(true),
url: url.default("http://localhost:3000"),
path: z.string().default(env.VERSIA_FRONTEND_PATH || cwd()),
routes: z.strictObject({
home: urlPath.default("/"),
login: urlPath.default("/oauth/authorize"),