Mock
Mock can generate random data so that the front-end siege lion can develop independently of the back-end.
First create the react project, and then yarn reject, exposing the webpack configuration.
The point is this.
Those who have learned node.js know that this is the secondary routing plus middleware configuration in the express framework, and then modify the directory to path.js under config
.
Restart the server and try to access
the data displayed is our corresponding data.
Add, delete, modify and check based on node
Define an object, which contains various methods,
read operations,
write operations,
additions, deletions, and modifications.
Assuming that the data here is in array JSON format
use
First define a json file, which contains an empty array. Be sure to empty the array, otherwise it will be an object. The object does not have a Push method.
Then you can use it directly.
Effect
Use the plugin BodyParser to get the body
Find the file and import
it so it can be used.