1、运行终端 npm init -y 创建一个 package.json 文件
    2、在 package.json 文件中 头部那 创建一个 “type”: “module”
    3、在终端运行 npm i express@4.17.1 mysql2@2.2.5 安装第三房依赖包
    4、创建基本的服务器 (在根目录中 新建一个 app.js)
    image.png
    5、写好以上代码的时候 在终端运行 nodemon app.js
    6、创建 db 数据库操作模块 ( 在根目录创建 db 文件夹 然后在db 文件夹里面创建 index.js)
    image.png
    7、创建 user_ctrl 模块 ( 在根目录 创建 controller 文件夹 在里面创建 user_ctrl.js 文件 )
    image.png
    8、创建 user_router 模块 ( 在根目录 创建 router 文件夹 在里面 创建 user_router.js 文件)
    image.png
    9、导入并挂载路由模块 ( 在 app.js 文件里面 导入 命名 userRouter 的文件 , 并挂载用户路由
    image.png
    10、使用 try…catch 捕获异常
    image.png