mockifye-cli
v1.0.2
Published
A CLI tool for mocking APIs with fake data
Readme
mockifye-cli
mockifye-cli is a CLI tool for quickly mocking APIs with fake data. You can easily spin up a mock API server to simulate real-world data for testing or development.
Features
- Mock APIs with fake data from a JSON file.
- Set custom ports for your server.
- Lightweight and easy to use with just a few commands.
Installation
To install mockifye-cli, run the following command:
npm install -g mockifye-cliAlternatively, you can install it as a dev dependency:
npm install --save-dev mockifye-cliUsage
Once installed, you can run the CLI to start a mock API server. Use the --data flag to specify the path to your fake data JSON file and the --port flag to set the server's port.
Example:
npx mockifye-cli --data ./fake-data.json --port 8080This will start the mock server on http://localhost:8080, and the mock data will be served as JSON.
CLI Options
--data(or-d): Path to the fake data JSON file (required).--port(or-p): Port to run the mock server on (default:8080).
Example Fake Data (fake-data.json):
[
{
"id": 1,
"name": "John Doe",
"email": "[email protected]"
},
{
"id": 2,
"name": "Jane Smith",
"email": "[email protected]"
}
]License
This project is licensed under the MIT License
