hot-mock-server
v2.0.1
Published
An HTTP Server for Mock Data.
Downloads
2
Maintainers
Readme
hot-mock-server
A HTTP Server for Mock Data.
Features
- Hot reload when change data files
- Support request with JSON format body
- Response with static data
- Manual handle request and response
- CORS (allow all CORS request)
Dependencies
- express: http server framework
- cors: support cors
- morgan: print access log
- body-parser: parse json body
- caller: figure out the caller, to generate module path
- commander: generate command-line interface
- chokidar: watch mock files
Preparations
- node >= 6.0.0
- npm >= 3.8.6
Usage
npm install -g hot-mock-server
(maybe need root authorization)hmserver -d <data dir path> -p <port>
Attentions
- Data directory sample:
data-sample
- Conmmand sample:
hmserver -d "./data-sample" -p 3000
Licence
MIT