14 lines
508 B
TypeScript
14 lines
508 B
TypeScript
export default defineNuxtPlugin(() => {
|
|
// This plugin runs only on the client side to avoid issues with server-side rendering
|
|
if (import.meta.client) {
|
|
// Initialize server health monitoring as soon as the client is ready
|
|
const { startPeriodicHealthCheck } = useServerHealth()
|
|
|
|
// Start the health check with a 1-minute interval
|
|
// This ensures the health check starts even if app.vue's onMounted hasn't fired yet
|
|
nextTick(() => {
|
|
startPeriodicHealthCheck(60000)
|
|
})
|
|
}
|
|
})
|