import { Router, Request, Response } from 'express'; import { isRembgConfigured } from '../intake/rembgClient'; const router = Router(); /** * What the admin screens can offer in this environment. * * Behind `requireAdminGate` like every other admin router, and deliberately not * folded into `/api/config` — the same reasoning `adminVersion.ts` records. * That endpoint is public and the storefront fetches it on every load; nothing * here is any of a customer's business. * * It exists because the inventory screen has no other way to learn this. * `GET /api/admin/item-drafts` carries the flag for the review queue, but * `GET /api/admin/items` answers a bare array with several consumers, and * changing its shape for one boolean would be a worse trade than one small * route. * * Not wrapped in `asyncRoute` because the handler is synchronous: it reads an * environment variable, so there is no promise to reject. */ router.get('/', (_req: Request, res: Response) => { res.json({ backgroundRemoval: isRembgConfigured() }); }); export default router;