![create fake app create fake app](https://consumingtech.com/wp-content/uploads/2017/03/fake-chat-install.png)
Open a new tab in Postman and run the query ( with the PATCH operation.Let’s modify the first name of the record with id 2 If you make a GET call, you should only see 3 users now.This indicates that the object with the respective id is successfully deleted Open the db.json file and replace the content with the following: object.Let’s go ahead and create a simple REST API that performs all CRUD operations-GET/POST/PUT/DELETE It has predefined 3 resources: posts, commands, profile. These resources are picked from the db.json file. When you hit you should see the following output.When you run the server locally, it tries to search for the file (db.json) and if not found, it creates a file on its own with mock JSON data. You should see a file named db.json created in the folder.Npm run json:server. It’ll run your server locally on Open the command prompt and navigate to the folder. To do so, open the package.json file and add a key-value in the scripts object after line 7: “json:server”:”json-server - watch db.json”.
CREATE FAKE APP INSTALL
To install json-server globally, run npm install -g json-server. The folder structure looks as follows:
![create fake app create fake app](https://imag.malavida.com/mvimgbig/download-fs/fakeapp-20701-2.jpg)
![create fake app create fake app](https://play-lh.googleusercontent.com/iW4utjrdkxhicSTf4jFzmhXUjH32ppAh828KAdZUK2AvdL_eQbqHg973tPNUflpiNF0=h1024-no-tmp_dummy_app_fake_chat_post_profile_story_live_prank_apk_poster.jpg)
CREATE FAKE APP HOW TO
In this article, we’ll look at one such approach on how to create a REST API with all the CRUD operations - GET, POST, PUT, DELETE JSONPlaceholder where you need to connect to the backend with some mock data with almost no knowledge of creating a server and writing REST APIs to connect your frontend with the database. Simple Answer: It is useful for building frontend apps with something like Angular, React, UI5, etc. First things first: Why would someone fake a REST API for their application?