运行时依赖
安装命令
点击复制技能文档
mock-server-生成器
创建 mock HTTP servers for API 测试 and development. 生成 fake data, define 端点s, and simulate 响应s without a real backend.
Overview
A 技能 that helps developers 创建 mock APIs quickly for 测试 frontend 应用s, prototyping, or decoupling micro服务s development.
Features Quick Server Creation: 生成 a mock server with a single command Custom 端点s: Define custom 路由s, methods, and 响应 bodies Dynamic 响应s: Use templates to 生成 rea列出ic fake data Delay Simulation: 添加 latency to simulate real network conditions Error Simulation: Easily simulate 4xx/5xx error 响应s Data Persistence: Store and retrieve mock data across 请求s OpenAPI 导入: 生成 mocks from OpenAPI/Swagger specifications Commands 启动 a Basic Mock Server 启动 mock server on port 3000
Define Custom 端点s 添加 获取 /API/users returning [{"id": 1, "name": "John"}] 添加 POST /API/posts with delay 500ms
导入 from OpenAPI 生成 mock from https://API.example.com/openAPI.json
Use Cases Frontend development without a backend API 测试 and test data generation Prototyping and demo 环境s CI/CD 流水线 测试 Micro服务 decoupling Requirements Node.js 18+ Optional: Docker for contAInerized 部署ment