Skip to content
| Marketplace
Sign in
Visual Studio Code>Testing>InstantMockNew to Visual Studio Code? Get it now.
InstantMock

InstantMock

Vikas Bairi

|
1 install
| (0) | Free
A VS Code extension that serves mock REST endpoints from mock-api.json with one-command start/stop controls.
Installation
Launch VS Code Quick Open (Ctrl+P), paste the following command, and press enter.
Copied to clipboard
More Info

InstantMock

InstantMock runs a local HTTP mock server directly inside VS Code using JSON route definitions.

Key Features

  • One command to toggle server state: InstantMock: Toggle Server
  • One command to preselect or change mock file: InstantMock: Select Mock File
  • Status bar indicator for ON/OFF state
  • Route matching by path and HTTP method
  • Configurable response status, JSON body, and delay per route
  • Startup port prompt with 3000 prefilled as recommended
  • Startup mock-file picker with remembered recommended file path
  • CORS headers enabled for local frontend development

Quick Start

  1. Create a JSON mock config file (for example mock-api.json in your workspace root).
  2. Open Command Palette (Cmd+Shift+P on macOS).
  3. Run InstantMock: Toggle Server.
  4. Choose the mock file:
  5. Use recommended file (last selected, or workspace mock-api.json) or browse any local file.
  6. Confirm or enter the server port (3000 recommended).
  7. Call your endpoints on http://localhost:<selected-port>.

Example mock-api.json:

{
  "routes": [
    {
      "path": "/api/health",
      "method": "GET",
      "status": 200,
      "body": {
        "status": "ok"
      }
    }
  ]
}

Command

  • InstantMock: Toggle Server
  • InstantMock: Select Mock File

Setting

  • instantMock.port: Server port setting (default 3000) available for compatibility.
  • Contact us
  • Jobs
  • Privacy
  • Manage cookies
  • Terms of use
  • Trademarks
© 2026 Microsoft