MockServer for VS Code
Start, stop, and manage MockServer Docker containers directly from Visual Studio Code.
Prerequisites
Installation
Install from the VS Code Marketplace or search for "MockServer" in the Extensions view.
For Open VSX (Eclipse Theia, Gitpod, etc.), install from open-vsx.org.
Commands
Open the Command Palette (Cmd+Shift+P / Ctrl+Shift+P) and type "MockServer":
| Command |
Description |
| MockServer: Start (Docker) |
Pulls and starts mockserver/mockserver:7.1.0 on port 1080 |
| MockServer: Stop |
Stops the running MockServer container |
| MockServer: Open Dashboard |
Opens the MockServer dashboard in your browser |
Snippets
In any .json file, type:
mockserver-expectation - inserts a full expectation template (request + response)
mockserver-forward - inserts an expectation with a forward action
mockserver-verify - inserts a verify request template
Quick Start
- Run MockServer: Start (Docker) from the Command Palette
- Create expectations by POSTing JSON to
http://localhost:1080/mockserver/expectation
- Run MockServer: Open Dashboard to inspect recorded requests
- Run MockServer: Stop when done
Building from Source
npm install
npm run compile
npm test
Packaging
npx vsce package
This produces a .vsix file you can install manually via code --install-extension mockserver-*.vsix.
License
Apache-2.0
| |