import { demoAppApplicationId } from '@logto/schemas/lib/seeds'; import { MiddlewareType } from 'koa'; import { findApplicationById } from '@/queries/application'; export default function koaCheckDemoApp(): MiddlewareType< StateT, ContextT, ResponseBodyT > { return async (ctx, next) => { try { await findApplicationById(demoAppApplicationId); await next(); return; } catch { ctx.throw(404); } }; }