Skip to content

Local mock server with both VS Code extension and CLI support, featuring JSON configuration, tree view management, and dynamic response templates.

License

Notifications You must be signed in to change notification settings

m-cho/proxy-mocksy

Repository files navigation

Proxy Mocksy

npm npm JSR JSR Score JSR JSR Score Docker

A local mock server with VS Code integration and CLI support for accelerated development. Proxy Mocksy allows you to quickly set up mock API endpoints both within VS Code and as a standalone CLI tool, perfect for frontend development, API testing, automation, and prototyping.

Packages

This is a monorepo containing four packages:

Features

  • 🚀 Quick Setup: Start a mock server instantly from VS Code or command line
  • 🎯 Visual Management: Tree view showing all configured endpoints and methods
  • 📝 JSON Configuration: Simple JSON-based endpoint configuration with schema validation
  • 🔄 Hot Reload: Automatic server restart when configuration changes
  • 📊 Status Integration: Server status visible in VS Code status bar
  • 🎨 Template Variables: Dynamic responses using request data
  • 🛠️ Development Focused: Built for both interactive and headless workflows
  • 💻 CLI Support: Run as standalone tool for automation and CI/CD
  • 🦕 Deno Compatible: Native support for Deno runtime via JSR
  • 🐳 Docker Ready: Containerized deployment for consistency across environments
  • IntelliSense: Auto-completion and validation for configuration files
  • 🎯 Context Awareness: Smart UI that adapts to configuration file presence

Quick Start

CLI

Node.js/npm

# Install globally
npm install -g @proxy-mocksy/cli

# Run with default config
proxy-mocksy

# Or with custom config and port
proxy-mocksy --config ./proxy-mocksy-config.json --port 3000

# Or use npx (no installation required)
npx @proxy-mocksy/cli --config ./proxy-mocksy-config.json --port 3000

Deno

# Run directly from JSR (recommended)
deno run jsr:@proxy-mocksy/cli

# With custom configuration
deno run jsr:@proxy-mocksy/cli --config ./proxy-mocksy-config.json --port 3000

Docker

# Pull and run with your config
docker pull milancho/proxy-mocksy:latest

docker run -p 8888:80 \
  -v $(pwd)/proxy-mocksy.config.json:/app/config/proxy-mocksy.config.json \
  milancho/proxy-mocksy:latest

# Your mock server is now running at http://localhost:8888

VS Code Extension

  1. Install the extension (not yet published)
  2. Open a workspace folder
  3. Create or open a configuration file with full JSON schema support
  4. Use the Proxy Mocksy activity bar panel to manage your mock server

Documentation

For detailed usage instructions, see the individual package READMEs:

Development

This project uses:

  • TypeScript for type safety and ES2022 modules
  • Turborepo for monorepo management
  • @needle-di/core for lightweight dependency injection
  • Koa for the HTTP server framework
  • Commander.js for CLI argument parsing
  • Docker for containerization
  • JSR for Deno-compatible package publishing

Building

npm run build:all

Running CLI in development

npm run cli:start:withExample

Docker Tasks

# Build Docker image
turbo run docker:build --filter=@proxy-mocksy/docker

# Start container with example config
turbo run docker:startWithExample --filter=@proxy-mocksy/docker

License

LGPL-2.1-only

Contributing

See individual package READMEs for development setup and contribution guidelines.


Happy Mocking! 🎭

About

Local mock server with both VS Code extension and CLI support, featuring JSON configuration, tree view management, and dynamic response templates.

Resources

License

Stars

Watchers

Forks

Packages

No packages published