A simple mock server, more easy to deploy and easy to use. It is base on express and ant-design.
Node >= 6.0.0
First of all, get the code from github.
git clone https://github.com/mmillet/mock-server.git
Then copy data_template to data path and install dependences.
cd mock-server
cp data_template data -r
npm install && npm run build
Now you can run server like this. You can manage APIs at http://localhost:9999/~m (default auth is: user / 123456
).
node ./server.js 9999
You can run dev_server (express) and webpack_dev_server (frontend) with this command.
npm run dev
Q: How to modify auth?
A: Modify manageUsername/managePassword values in ./data/settings.json
.
Q: Can I run with pm2?
A: Of course, you can run server by other node process manager, like pm2. If you have installed pm2, try to start server by npm run server
. Good Luck!
Q: Where are the APIs stored?
A: They are stored ./data
path, if you want to create backup files, just copy this path.