- Require a session on every route; public routes opt out with @allow_anonymous - Split password hashing and pepper loading into passwords.py - Add a system/light/dark theme toggle backed by light-dark() colors - Ignore stale 401s from an earlier session, PATCH only changed book fields, and block overlapping journal-entry saves - Add bin/start and CoderPad Vite server settings for the pad's start/restart - Rewrite README as a mise onboarding guide; expand .gitignore - Include review-round fixes and tests
32 lines
896 B
TypeScript
32 lines
896 B
TypeScript
/// <reference types="vitest/config" />
|
|
|
|
import tailwindcss from "@tailwindcss/vite";
|
|
import react from "@vitejs/plugin-react";
|
|
import { createLogger, defineConfig } from "vite";
|
|
|
|
// Set only inside a CoderPad pad, whose preview proxies port 3000 and the HMR websocket.
|
|
const padHost = process.env.PROJECTS_BASE_HOST;
|
|
|
|
export default defineConfig({
|
|
plugins: [react(), tailwindcss()],
|
|
server: {
|
|
proxy: { "/api": { target: "http://127.0.0.1:5000", changeOrigin: true } },
|
|
...(padHost
|
|
? {
|
|
host: "0.0.0.0",
|
|
port: 3000,
|
|
hmr: { clientPort: Number(process.env.WEBSOCKET_PORT) },
|
|
allowedHosts: [`.${padHost}`],
|
|
}
|
|
: {}),
|
|
},
|
|
...(padHost
|
|
? { customLogger: createLogger("info", { prefix: "[coderpad]" }) }
|
|
: {}),
|
|
test: {
|
|
environment: "jsdom",
|
|
setupFiles: ["./src/test/setup.ts"],
|
|
unstubGlobals: true,
|
|
},
|
|
});
|