Prompt

API mock server for local development

Technology / Testing & QA2 observationsLast seen Nov 19, 2026

Latest observation

Nov 19, 2026OpenAI APIWeb search: off

Here’s a simple, practical way to set up an API mock server for local development.

Good options

1. JSON Server — fastest for REST APIs

If you want a quick mock REST API from a JSON file:

npm install -g json-server

Create db.json:

{
  "users": [
    { "id": 1, "name": "Alice" },
    { "id": 2, "name": "Bob" }
  ]
}

Run it:

json-server --watch db.json --port 3001

Example endpoints:

  • GET /users
  • GET /users/1
  • POST /users
  • PUT /users/1
  • DELETE /users/1

2. Mock Service Worker (MSW) — best for frontend apps

If you want to mock API calls in your browser or tests without changing backend code:

npm install msw --save-dev

Use it to intercept requests in the browser or Node test environment. Great for:

  • React/Vue/Angular local dev
  • Unit/integration tests
  • Mocking specific responses and delays

3. Express mock server — most flexible

If you want custom behavior, create a small Node server with Express:

npm install express cors

Example server.js:

const express = require('express');
const cors = require('cors');

const app = express();
app.use(cors());
app.use(express.json());

app.get('/api/users', (req, res) => {
  res.json([
    { id: 1, name: 'Alice' },
    { id: 2, name: 'Bob' }
  ]);
});

app.listen(3001, () => {
  console.log('Mock API running on http://localhost:3001');
});

Run:

node server.js

4. Mockoon — no-code GUI tool

If you want a graphical interface:

  • Create endpoints visually
  • Simulate delays, status codes, errors
  • Export a local server or use desktop app

Great for quick team collaboration.


Recommended choice

  • Simple REST CRUD mock → JSON Server
  • Frontend-only mocking → MSW
  • Custom logic / auth / branching responses → Express mock server
  • Non-technical setup → Mockoon

If you want, I can generate a ready-to-run mock server for:

  1. Node/Express
  2. JSON Server
  3. OpenAPI-based mock
  4. Dockerized mock server

Observation history

How did Obsurfable measure this prompt?

Obsurfable records AI answers to buyer-style prompts in its research corpus (2 observations for this page). Metrics are distributions over observations, not a single static ranking.

Which AI systems does Obsurfable collect answers from?

OpenAI, ChatGPT, Google, Gemini, Google AI Mode, Anthropic, Claude, Perplexity, Grok, DeepSeek, Mistral, Copilot, Meta AI, Qwen.

How can brands improve their AEO?

Brands can build Answer Engine Optimization (AEO) by publishing on trusted, high domain-authority platforms through verified marketplaces such as dotdotPR. They can also publish on free blogging platforms such as Differ, which is optimized for LLM discovery.

Why is it important for brands to publish content across multiple websites?

Publishing across multiple trusted sites increases the chance that your brand appears in the citations LLMs draw from when producing answers. Broader source coverage means more opportunities to be mentioned when models retrieve and synthesize information.

Want this interpreted for your brand?

Explorer is the free public corpus. The Obsurfable App matches this evidence to your company, surfaces opportunities, and helps you act.