Improve API response formatting and structure in handlers

This commit is contained in:
shuaiplus
2026-02-11 23:53:36 +08:00
parent c825280707
commit b33ee64c58
16 changed files with 87 additions and 137 deletions
+3 -1
View File
@@ -2,7 +2,9 @@ import { Env } from './types';
import { handleRequest } from './router';
import { StorageService } from './services/storage';
// Global flag to track if database has been initialized in this worker instance
// Per-isolate flag. Each Worker isolate may have its own copy of this flag,
// but initializeDatabase() is idempotent (uses CREATE TABLE IF NOT EXISTS),
// so redundant calls are harmless and fast (single SELECT check).
let dbInitialized = false;
export default {