Mock For Frontend
This package aim to help the frontend development by providing a wrapper over mockserver package.
Expectations
You just gonna need to create a new folder to store your expectations, for more info in how to create expectations you can find here and here
Sample
// ./expectations/login.json
Or
// ./expectations/js-sample.jsmodule { mockClient ;};
PS: The mock server load JSON expectation before JS expectations
How to use
Execute the following command
$ npm i -g mock-ff$ mock-ff help$ mock-ff start ./expectations/ -p 7777$ [optional] mock-ff stop -p 7777
PS: Make sure you have the right permissions to read/write in the folder you are executing the command or mock-ff will fail.
This command will start your mockserver on port 7777
Useful requests
Healthcheck
curl --request POST --url http://localhost:7777/mockserver/healthcheck
Recorded Requests and Responses
curl --request PUT --url 'http://localhost:7777/mockserver/retrieve?type=REQUEST_RESPONSES'
Dependencies
- JDK 11+