feat: Implement a gatekeeper service for access control and add CMS health monitoring with a connectivity notice.
Some checks failed
Build & Deploy KLZ Cables / 🔍 Prepare Environment (push) Successful in 21s
Build & Deploy KLZ Cables / 🧪 Quality Assurance (push) Successful in 1m24s
Build & Deploy KLZ Cables / 🏗️ Build & Push (push) Failing after 3m8s
Build & Deploy KLZ Cables / 🚀 Deploy (push) Has been skipped
Build & Deploy KLZ Cables / 🔔 Notifications (push) Successful in 2s

This commit is contained in:
2026-02-01 16:27:52 +01:00
parent 9e87720494
commit fcb3169d04
11 changed files with 327 additions and 6 deletions

View File

@@ -89,4 +89,20 @@ export async function getProductBySlug(slug: string, locale: string = 'de') {
}
}
export async function checkHealth() {
try {
await ensureAuthenticated();
// Try to fetch something very simple that should exist if initialized
await client.request(readItems('directus_collections', { limit: 1 }));
return { status: 'ok', message: 'Directus is reachable and responding.' };
} catch (error: any) {
console.error('Directus health check failed:', error);
return {
status: 'error',
message: error.message || 'Unknown error',
code: error.code || 'UNKNOWN'
};
}
}
export default client;