OverviewDeveloperHacker

Mockbox: A Local Mock API Server Driven by a Single Config File

Intermediate0 enrolled · 0 submitted

Want in? Run /enroll in Discord to claim this tier before the build window closes.

The brief

Front-end prototypes and small scripts often need an API that doesn't exist yet. Build Mockbox, a tiny local server that reads a YAML or JSON file describing routes and serves fake responses from it.

Your MVP: run one command, and a local server starts with the routes defined in your config file.

Core outcomes:

  • Define routes with method, path, status code, headers, and a JSON body in the config.
  • Support path parameters (e.g. /users/:id) and echo the parameter back in the response via simple templating.
  • Add an optional per-route delay_ms so users can simulate a slow network.
  • Log each request in a readable one-line format and return a helpful 404 listing known routes when nothing matches.

Everything runs locally with no external services. Stick to your favorite lightweight web stack or the standard library. Hot-reloading the config on change is a nice stretch goal, not a requirement.

Deliverables

  • A repo with the Mockbox server, runnable with a single command
  • An example config file showing at least four routes, including one with a path parameter and one with a delay
  • A README explaining the config format with copy-pasteable curl examples
  • A small test script or documented curl session proving each route behaves as configured

Resources