后端基于nodejs 由于编写时后端没有写接口文档 导致该项目只能用于交作业,但是有一定的学习价值
需要node环境
npm install
导入leyue.sql语句
app.listen(80, () => {
console.log('http://127.0.0.1');
})
req.db = mysql.createPool({
host: 'localhost',//主机名
user: 'root',//用户名
password: 'root',//密码
database: 'Leyue'//所操作的数据库
})
node index,js