Prompt
API mock server for local development
Latest observation
Oct 6, 2026
OpenAI APIWeb search: off
If you want an API mock server for local development, here are a few solid options depending on what you need:
Quick, lightweight options
-
json-server
Great if you have a JSON file and want a REST API fast.- Easy to set up
- Supports CRUD
- Good for frontend dev
-
Mockoon
- GUI-based mock API tool
- Very fast to create endpoints
- Can run locally or as a desktop app
-
WireMock
- Better for more advanced stubbing
- Useful if you need request matching, delays, faults, etc.
If you’re using an OpenAPI spec
-
Prism
- Mocks APIs directly from OpenAPI/Swagger definitions
- Good for spec-first workflows
-
Stoplight Mock Server
- Also OpenAPI-based
- Nice for collaborative API design
If you want to implement your own
A simple local mock server can be built with:
- Node.js + Express
- FastAPI (Python)
- Flask (Python)
Example with Express:
import express from "express";
const app = express();
app.use(express.json());
app.get("/api/users", (req, res) => {
res.json([
{ id: 1, name: "Alice" },
{ id: 2, name: "Bob" }
]);
});
app.post("/api/login", (req, res) => {
res.json({ token: "mock-token-123" });
});
app.listen(3001, () => {
console.log("Mock API running on http://localhost:3001");
});
Recommendation
- Frontend-only mock data:
json-serverorMockoon - OpenAPI-driven:
Prism - Advanced API behavior:
WireMock - Custom logic:
ExpressorFastAPI
If you want, I can help you set up a mock server in Node.js, Python, or Docker right now.