# node-server-mysql **Repository Path**: iced-chicken/node-server-mysql ## Basic Information - **Project Name**: node-server-mysql - **Description**: node服务器模板(express+MySQL) - **Primary Language**: NodeJS - **License**: Not specified - **Default Branch**: master - **Homepage**: None - **GVP Project**: No ## Statistics - **Stars**: 1 - **Forks**: 1 - **Created**: 2025-04-11 - **Last Updated**: 2025-04-11 ## Categories & Tags **Categories**: Uncategorized **Tags**: None ## README ## Express >项目基于`express`+`sequelize`+`mysql`+`express-validator` > 基于node+express API接口项目,包括成语诗歌、历史的今天接口数据 - [x] express - [x] sequelize - [x] mysql - [x] `express-validator`参数表单校验 - [x] 集成`swaggerUI`接口文档 - [x] `nodemon`项目开发动态热更新 - [x] `dotenv`管理配置系统参数 - [x] 包含接口sign请求验证 - [x] `log4js` 错误日志收集 ### 环境要求 >需要安装`node`环境,`mysql`数据库 ### 部署运行 ```shell $ npm install # start project dev $ npm run dev # starting prd $ npm run prd #localhost:3001 ``` ### 服务器部署 > 在服务器中使用 `pm2` 对 `node` 服务进行进程守护 ```shell #启动进程/应用 pm2 start npm --watch --name tools -- run prd pm2 restart tools pm2 stop tools pm2 delete tools ``` ### 数据库 >`mysql`中包含、唐诗300、历史的今天等数据 > 项目目录`bak-file`文件夹可查看 ### 接口文档 >启动项目之后`http://localhost:9001/api-docs/` 可查看接口文档页面 ### 错误码说明 | 状态码 | 含义 | 备注 | |------| ---------------------------------- | ---- | | 200 | 响应正常 | | | 1001 | 参数无效、如一个不存在的id | | | 1002 | 参数为空、验证不通过、参数类型错误 | | | 1003 | 请求签名异常、非法 | | 404 |请求不存在 | | 405 | 请求方式错误| | 9999 | 第三方接口请求异常| | 500 |系统异常|