2021年6月9日
摘要: //使用连接池连接mysql const mysql = require("mysql"); //创建连接池 password:"123", let pool = mysql.createPool({ host:"127.0.0.1", post:"3306", user:"root", datab 阅读全文
posted @ 2021-06-09 20:45 文种玉 阅读(263) 评论(0) 推荐(0) 编辑
摘要: /** * 使用node连接mysql模块 */ //引入MySQL数据库 const mysql = require("mysql"); //创建一个mysql连接对象,连接是使用对象来连接数据库 let connection = mysql.createConnection({ host:"12 阅读全文
posted @ 2021-06-09 20:44 文种玉 阅读(477) 评论(0) 推荐(0) 编辑
摘要: 创建 index.ejs <!DOCTYPE html> <html lang="en"> <head> <meta charset="UTF-8"> <meta http-equiv="X-UA-Compatible" content="IE=edge"> <meta name="viewport 阅读全文
posted @ 2021-06-09 20:22 文种玉 阅读(254) 评论(0) 推荐(0) 编辑
摘要: 图片请求案例 web页面如下 <!DOCTYPE html> <html lang="en"> <head> <meta charset="UTF-8"> <meta http-equiv="X-UA-Compatible" content="IE=edge"> <meta name="viewpo 阅读全文
posted @ 2021-06-09 20:12 文种玉 阅读(110) 评论(0) 推荐(0) 编辑
摘要: ejs 页面 作用,可以在页面当中编写 js 代码 页面中 页面的名称不是 html 后缀,而是 ejs 后缀 比如: <%- errData %> node中 需要安装 ejs npm i ejs 在node当中引入 ejs //引入ejs app.set("view engine","ejs") 阅读全文
posted @ 2021-06-09 19:45 文种玉 阅读(1024) 评论(0) 推荐(0) 编辑
摘要: 文件夹目录 连接数据库 const mongoose = require("mongoose"); mongoose.connect("mongodb://localhost:27017/school",{ useNewUrlParser: true, useUnifiedTopology: tru 阅读全文
posted @ 2021-06-09 19:39 文种玉 阅读(385) 评论(0) 推荐(0) 编辑