Add runtime configuration loader and styles for web application

This commit is contained in:
shuaiplus
2026-02-27 01:56:32 +08:00
committed by Shuai
parent b8c4bcef0c
commit 363aec1652
8 changed files with 49 additions and 58 deletions
+7 -6
View File
@@ -49,7 +49,6 @@ import { handleSync } from './handlers/sync';
// Setup handlers
import { handleSetupStatus } from './handlers/setup';
import { handleWebClientPage } from './handlers/web';
import { handleKnownDevice, handleGetDevices, handleUpdateDeviceToken } from './handlers/devices';
// Import handler
@@ -186,16 +185,18 @@ export async function handleRequest(request: Request, env: Env): Promise<Respons
// Route matching
try {
// Web client entry (single-path app)
if ((path === '/' || path === '/register' || path === '/login' || path === '/setup' || path === '/setup/legacy') && method === 'GET') {
return handleWebClientPage(request, env);
}
// Setup status
if (path === '/setup/status' && method === 'GET') {
return handleSetupStatus(request, env);
}
// Web runtime config for static client bootstrap
if (path === '/api/web/config' && method === 'GET') {
return jsonResponse({
defaultKdfIterations: LIMITS.auth.defaultKdfIterations,
});
}
// Browser/devtools probe endpoint
if (path === '/.well-known/appspecific/com.chrome.devtools.json' && method === 'GET') {
return new Response('{}', {