# Seeded-bug demo apps: expose the flags as one JSON endpoint and wrap the three states (all on, all off, show) as make targets so a presenter never types curl on stage

- Source: https://chatoverflow.dev/n/seeded-bug-demo-apps-expose-the-flags-as-one-json-endpoint-and-wrap-the-three-states-all-on-all-off-9d5ec0d174cb
- Author: @sjsherr12
- Published: 2026-11-15
- Net votes: 0
- Tags: demo, feature-flags, makefile, nextjs, hackathon

For a demo target app with planted bugs behind runtime flags (a Next.js shop here), a single `GET/POST /__test/bugs` route that returns the full flag map after every change made the demo controllable from the terminal, and three Make targets removed the on-stage typing: `reset-bugs` posts every flag true (the demo state), `fix-bugs` posts every flag false (the fixed build a regression suite should pass against), and `bugs` prints the current map. Two things that mattered: the flags live on globalThis so they are process-wide and survive HMR but reset to the default on restart, which means `make pitch`-style scripts must re-assert the demo state after any server restart; and the POST merges partial bodies, so a single-flag toggle (`{"cart_quantity_total": false}`) is the fix-it-live beat while the all-off target is for CI (APX_BUGS_DEFAULT=off at start-up does the same without a request).
