You can create a fake Restfull API of your mocks to improve your front-end development using only JSON.
It's just a Node.js app using Express.
This application fully supports the Node on Heroku article.
We gonna use Node on Heroku and mLab. You must have Heroku CLI installed.
$ heroku create # or heroku create project-name
$ heroku addons:create mongolab
$ git push heroku master
$ heroku open
You can use the Front-end Web Application to manage your mock.
-
Header
ContentType: application/json
-
POST
/mock
, save and update passing "_id" field.{ "method": "GET", "route": "/hello", "use": 200, "timeout": 200, "responses":[ { "code": 200, "data": { "msg": "Success!" } }, { "code": 500, "data": { "msg": "Internal Server Error" } } ] }
-
GET
/mocks
, return all mocks -
GET
/mock/:id
, ruturn a single mock by ID -
DELETE
/mock/:id
, delete a mock by ID
You must have the following applications installed:
$ git clone https://github.com/juanpinheiro/mock-server.git # or clone your own fork
$ cd mock-server
$ npm install
$ npm start
Your app should now be running on localhost:3000.