api-mocking
API Mocking
A mock is a folder, config.yaml plus a handler such as default.js, that
answers like an API. The handler is a Node HTTP server that calls
listen(process.env.PORT). It loads as CommonJS even in an ESM project, so
import fails: use require. The same mock lives in your repo
(postman/mocks/<name>/, run with postman mock run, no sign-in needed),
in a Postman workspace after postman mock push, where other teams pull it
from, and on a mock server after postman mock deploy, for callers that
can't run it themselves.
Several APIs at once, for a service, a frontend or a test suite? Use
api-simulation, which gets each member's mock here.
Use a published mock first
When the API belongs to another team or a third-party provider, look for a published mock before writing one: a maintained mock encodes the contract and the service's state; yours encodes a guess.