What is a JSON server?
JSON Server is a simple, lightweight, and mock server that allows you to quickly create a RESTful API with JSON data. It is often used for prototyping, front-end development, or testing purposes.
With JSON Server, you can define a JSON file as a database and expose RESTful endpoints to perform CRUD (Create, Read, Update, Delete) operations on that data. It provides a fully functional HTTP server that responds to various HTTP methods like GET, POST, PUT, and DELETE.
HOW TO MAKE A JSON SERVER IN REACT APP?
STEP1: Create a server folder in the react-js app
npm init -y
npm i json-server
"scripts": {
"start": "json-server --watch db.json -p 9000"
},
Comments
Post a Comment