• Download the mysql database from the official websiteCopy the code
  • You can install MySQL database management tools such as PhpMyAdmin or Navicat, which I used hereCopy the code
  • Install NodeJsCopy the code
    • Set up nodeJS server db.js file and make the following modificationsCopy the code

  • Navicat imports a database table whose name corresponds to db.js databaseCopy the code

  • Node server startup command: In the server folder, hold down shift and right click "Open powerShell window this time" and enter Node index. If the following information is displayed, the background service is successfully startedCopy the code

  • Nodejs write interface Interface for connecting to database tables User-defined
  • Postman test interface, background interface data returned successfully, can build front-end page