Skip to content
| Marketplace
Sign in
Visual Studio Code>Other>MockoroNew to Visual Studio Code? Get it now.
Mockoro

Mockoro

voyoro

| (1) | Free
在 VS Code 中一键启动 Mockoro 服务,并监听当前工作区的 mock.yaml。
Installation
Launch VS Code Quick Open (Ctrl+P), paste the following command, and press enter.
Copied to clipboard
More Info

Mockoro Helper

Start/stop the Mockoro local server from VS Code with a single command and automatically inject the workspace mock.yaml.

Features

  • One‑click control: Start/stop the Mockoro server via the Command Palette
  • Port auto selection: Finds an available port in the 3000–3999 range
  • Config injection: If mock.yaml exists at the workspace root, inject it as MOCK_YAML_PATH
  • Bundled runtime: Runs the server from the packaged out/server/index.mjs
  • Status & logs: In‑editor status notifications with [mockoro] prefixed logs

Commands

Run from the Command Palette (Ctrl+Shift+P / Cmd+Shift+P):

  • Mockoro: Start (mockoro.start): Start the server
  • Mockoro: Stop (mockoro.stop): Stop the server

Settings

In VS Code settings:

{
  "mockoro.autoStart": false
}
  • mockoro.autoStart (boolean, default false): Automatically start Mockoro when VS Code launches

Usage

  1. Open a project that contains mock.yaml (optional; if absent, MOCK_YAML_PATH is not set)
  2. Run Mockoro: Start
  3. After the success notification, visit an address like http://localhost:3000
  4. To stop, run Mockoro: Stop

Note: The current implementation picks mock.yaml from the first workspace folder. Auto‑restart on file change is not enabled (a watcher scaffold exists in code).

Logs & Troubleshooting

  • Missing server directory: If you see “service directory not found: <.../out/server>”, ensure the build includes out/server/index.mjs
  • Port already in use: The extension will try other ports automatically; if it still fails, check local listeners or firewall
  • View logs: Inspect [mockoro] logs in the Output/Debug Console

Development & Packaging

github: https://github.com/Voyoro/mockoro.git

# Install deps and build inside the vscode-extension directory
npm i
npm run compile

# Package VSIX (requires vsce or the provided npm script)
npm run package

The runtime entry is out/server/index.mjs and should be shipped with the VSIX.

License

MIT License © wangyi

  • Contact us
  • Jobs
  • Privacy
  • Manage cookies
  • Terms of use
  • Trademarks
© 2025 Microsoft