Getting started
Setup your local via NPM
Installation
Mock JSON Response is distributed via node package manager and can be included in your project using package.json
To add the mock-json-response as a project dependency, create a project
Once the project is created, initialize npm
follow the instruction on the terminal and enter the necessary information, now it time to install mock-json-response
after the package is loaded in your environment, create 2 new folders for data and functions.
Its time to launch the app. Before we launch it we need to import module, create an index.js
Create a JS file in the functions directory: hello.js
Now start the program:
and wait for the server to start up
Now send a request via browser, postman or terminal to localhost:3000/mock/test
The default port of the server is 3000, once the route is hit, you will get the response
You have successfully, setup backend mock.
Last updated