- ✅
JSON
andping
example included - ✅ Customizable
- Node.js >=
v6.10.0
- npm >=
3.10.10
- Install dependencies
$ npm install
$ npm start
And now just navigate to http://localhost:8081
- Install Nodemon
$ npm install -g nodemon
- Run script
$ nodemon app.js
- Get
/ping
- Get
/users
![]() |
-
Create file with json-response and save in into
./mocks
:$ echo '{ "message": "Hello, World!" }' >> ./mocks/hello-world.json
-
Add new endpoint to
app.js
:app.get('/hello', function(req, res) { ExpressUtils.jsonRouteToFile('./mocks/hello-world.json', req, res); });
Where
/hello
it's new endpoitn name. And./mocks/hello-world.json
is path to the file with new response. -
Run
$ npm start
![]() |
You can add any response using feature of Express