There are no items in your cart
Add More
Add More
| Item Details | Price | ||
|---|---|---|---|
Learn how to start a demo Rest API on a JSON Server
Below tutorial will show how to start a demo Rest API on a JSON Server without writing a single piece of code. It will also show how you can test the API using Rest-Assured.
Steps:
1. Download Node.js on your machine. (https://nodejs.org/en/download/)
2. Install Node.js
3. Open Command Prompt and check that npm and node is installed
node -v
npm -v
4. Install JSON Server
npm install -g json-server
5. Create a db.json file with some data
6. Start JSON Server
json-server --watch db.json

7. Open http://localhost:3000/posts in any browser to view JSON response

8. Write the following code to test a POST request on the demo Rest API running on the localhost.

9. Again open the URL(https://localhost:3000/posts) and notice that a new post is added to the api.
Reference: https://github.com/typicode/json-server

Bijan Patel
Full Stack Test Automation Expert | Selenium Framework Developer | Certified Tosca Automation Specialist | Postman | DevOps | AWS | IC Agile Certified | Trainer | Youtuber | Blogger|