unoffical wafrn mirror wafrn.net
atproto social-network activitypub
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

health check endpoint

+29
+29
packages/backend/routes/frontend.ts
··· 29 29 } 30 30 } 31 31 32 + app.get('/api/health', async (req, res) => { 33 + const health = { 34 + uptime: process.uptime(), 35 + timestamp: Date.now(), 36 + status: 'ok', 37 + checks: { 38 + database: 'unknown', 39 + redis: 'unknown', 40 + } 41 + } 42 + 43 + try { 44 + await sequelize.authenticate() 45 + health.checks.database = 'ok' 46 + } catch (error) { 47 + health.checks.database = 'error' 48 + health.status = 'degraded' 49 + } 50 + 51 + try { 52 + await redisCache.ping() 53 + health.checks.redis = 'ok' 54 + } catch (error) { 55 + health.checks.redis = 'error' 56 + health.status = 'degraded' 57 + } 58 + 59 + res.status(health.status === 'ok' ? 200 : 503).json(health) 60 + }) 32 61 app.get('/api/disableEmailNotifications/:id/:code', async (req: Request, res: Response) => { 33 62 let result = false 34 63 let userId = req.params.id