Skip to main content

Posts

Showing posts with the label JSON-server

JSON Server: Rest API

I get that a lot that there are so many folks especially college students who struggle to find Rest APIs where they can play not only with the GET but with POST, PUT, DELETE methods too. The JSON Server is a popular and handy tool that lets you play with the mock REST APIs. It helps you to set up a REST API with CRUD operations very fast. Please go through this link to know more about it: https://github.com/typicode/json-server From set-up >> installation >> usage- everything is so simple. I recommend to use it along with the faker library to make it more effective: https://github.com/Marak/faker.js , like by creating a js file to inject the fake data: module.exports = () => { var faker = require("faker"); const data = { users: [] } // Create 50 users for (let i = 0; i < 50; i++) { data.users.push({ id: i, name: faker.name.findName(),email:faker.internet.email(), zipCode: faker.address.zipCode()}) } return data } Here's th