mockini
v1.0.0
Published
Mock REST API server from a JSON config
Maintainers
Readme
⚡ mockini
mockini is a lightweight CLI tool to instantly spin up mock REST APIs using a simple JSON config file.
Designed for frontend developers, testers, and backend teams who need mock endpoints without writing server logic.
🚀 Features
- ⚡ Zero-config mock server
- 🛠 Simple JSON-based route definition
- 🧩 Supports GET, POST, PUT, DELETE, etc.
- ✨ CLI:
initto generate config,startto launch server - 🧠 Convention-based: uses
mockini.config.jsonby default - 🐇 Built with Bun (but runs as a native CLI via npx/npm)
📦 Getting Started
1. Create a config file
npx mockini initCreates a file: ./mockini.config.json
You can also manually create it:
{
"port": 3000,
"routes": [
{
"method": "GET",
"path": "/hello",
"status": 200,
"response": { "message": "Hello, world!" }
}
]
}2. Start the mock server
npx mockini startBy default, it uses ./mockini.config.json.
You can override the path with:
npx mockini start --config ./myconfig.jsonYou can also install globally:
npm install -g mockini
mockini init
mockini start🧩 CLI Commands
| Command | Description |
|------------------|--------------------------------------------|
| mockini init | Generate a default mock config file |
| mockini start | Start mock server from config file |
📁 Project Structure
mockini/
├── bin/ # CLI entry point
├── src/ # Server and init logic
├── docs/ # Additional documentation
├── mockini.config.json # Default config (generated)
├── README.md # This file🛠 Tech Stack
- 🐇 Bun (development runtime)
- 🧪 Express (mock server)
- 🧾 Commander (CLI parser)
📄 License
MIT © 2025 Chhatra Rana
