https://github.com/ronffy/mockjs-server-cli
An express server that relies on mockjs to simulate the CLI of interface data
https://github.com/ronffy/mockjs-server-cli
Last synced: about 2 months ago
JSON representation
An express server that relies on mockjs to simulate the CLI of interface data
- Host: GitHub
- URL: https://github.com/ronffy/mockjs-server-cli
- Owner: ronffy
- License: mit
- Created: 2019-06-14T02:39:06.000Z (about 7 years ago)
- Default Branch: master
- Last Pushed: 2019-07-14T12:18:01.000Z (almost 7 years ago)
- Last Synced: 2025-06-12T07:09:18.420Z (about 1 year ago)
- Language: JavaScript
- Size: 84 KB
- Stars: 1
- Watchers: 0
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# mockjs-server-cli
[](https://www.npmjs.com/package/mockjs-server-cli)
An express server that relies on mockjs to simulate the CLI of interface data
[View examples](https://github.com/ronffy/mockjs-server-cli/tree/master/exemple)
## Install
```shell
npm install mockjs-server-cli
```
## Usage
### mode1
You can add mock.config.js to the project root directory
project-root
```
+ |- mock.config.js
```
Running commands
```shell
mockjs-server
```
### mode2
You can also place mock.config.js somewhere else, or change it to another name.
project-root
```
+ |- /config
+ |- mock.config.js
```
Running commands
```shell
mockjs-server --port=8888 --config=config/mock.config.js
```
### options
- `-p, --port`(default: `8888`) - server port
- `--config`(default: `${cwd}/mock.config.js`) - path to the mock config file
- `--delay` - simulate http delay