VS Code Extensions
InstantMock

InstantMock

by Vikasrb

A VS Code extension that serves mock REST endpoints from mock-api.json with one-command start/stop controls.

Downloads

3

Rating

— (0)

Version

1.0.2

Last updated

Jul 14, 2026

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.

Related extensions