forked from
jollywhoppers.com/witchsky.app
Bluesky app fork with some witchin' additions 馃挮
1import {Express} from 'express'
2import {sql} from 'kysely'
3
4import {AppContext} from '../context.js'
5import {handler} from './util.js'
6
7export default function (ctx: AppContext, app: Express) {
8 return app.get(
9 '/_health',
10 handler(async (_req, res) => {
11 const {version} = ctx.cfg.service
12 try {
13 await sql`select 1`.execute(ctx.db.db)
14 return res.send({version})
15 } catch (err) {
16 return res.status(503).send({version, error: 'Service Unavailable'})
17 }
18 }),
19 )
20}