feat: migrate frontend to Astro + expand AI moderation + backend admin/runtime config
Frontend: - migrate from Vite to Astro (astro.config.mjs, pages/, layouts/) - add admin panel, settings page, command palette, error boundary - refactor App.tsx, MascotChatbot, Sidebar, Header, DashboardLayout - update API client, WebSocket, auth, dashboard features Backend: - add admin module and config routes - refactor middlewares, Redis connection, WebSocket server/bridge - add runtime config loader Discord Gateway: - refactor AI moderation: circuit breaker, concurrency limiter, fallback processor - add media analysis client, Seaxng search, user profile learner - add new drizzle migration Shared: - extend database schema, add new config fields
This commit is contained in:
@@ -4,7 +4,15 @@
|
||||
*/
|
||||
import { describe, it, expect } from "vitest";
|
||||
|
||||
const BASE = process.env.API_BASE ?? "https://imphnen.asepharyana.my.id/api";
|
||||
// Safety: never default to a production URL — forces explicit opt-in
|
||||
// via: API_BASE=http://localhost:3001/api vitest run
|
||||
const RAW = process.env.API_BASE;
|
||||
if (!RAW) {
|
||||
throw new Error(
|
||||
"API_BASE is not set. Run with: API_BASE=http://localhost:3001/api vitest run",
|
||||
);
|
||||
}
|
||||
const BASE = RAW;
|
||||
|
||||
async function api(path: string, init?: RequestInit) {
|
||||
const res = await fetch(`${BASE}${path}`, {
|
||||
|
||||
Reference in New Issue
Block a user