Use of jSON-server (simulated local data interface)
1. Install the JSON Server
npm install -g json-server
Copy the code
2. Create a DB folder in the root directory of the project and initialize the JSON file
3. Package. json Creates the service command and starts the service
-
create
[command name] : "json-server./db/[file name]. Json ",Copy the code
-
create
NPM run [command name]Copy the code
successful
Then go directly to Resources
Git address: json-server