import { httpStatus } from 'http-codex/status' import type { Context } from 'hono' import type { APIError } from '../helpers/errors' import type { HonoApp } from '../types' /** Handles typical notFound hooks */ export function withNotFound() { return async (ctx: Context): Promise => { const c = ctx as unknown as Context return c.json(notFoundResponse, httpStatus.NotFound) } } export const notFoundResponse = { success: false, error: { message: 'not found' }, } satisfies APIError