0
Fork 0
mirror of https://github.com/logto-io/logto.git synced 2025-01-13 21:30:30 -05:00
logto/packages/core/src/routes/status.ts
Gao Sun 6c39790180
feat(core): add response guard (#1542)
* feat(core): add response guard

* refactor(core): print error if not prod
2022-07-15 17:01:51 +08:00

11 lines
293 B
TypeScript

import koaGuard from '@/middleware/koa-guard';
import { AnonymousRouter } from './types';
export default function statusRoutes<T extends AnonymousRouter>(router: T) {
router.get('/status', koaGuard({ status: 204 }), async (ctx, next) => {
ctx.status = 204;
return next();
});
}