上一页 1 ··· 14 15 16 17 18 19 20 21 22 ··· 35 下一页
  2021年6月10日
摘要: 概述 协商缓存: 1. 客户端向服务端发送一个请求,请求相应的资源 2. 服务端向客户端发送一个响应,在响应头中携带两个关于缓存的信息,分别是 当前文件的唯一标识 (eTag)和 当前文件的最后一次修改时间(last-modified) 3. 客户端收到了响应文件和关于文件的缓存信息,并把缓存信息保 阅读全文
posted @ 2021-06-10 16:24 谢晨锋 阅读(112) 评论(0) 推荐(0)
摘要: web页面代码如下 <!DOCTYPE html> <html lang="en"> <head> <meta charset="UTF-8"> <meta http-equiv="X-UA-Compatible" content="IE=edge"> <meta name="viewport" c 阅读全文
posted @ 2021-06-10 16:20 谢晨锋 阅读(114) 评论(0) 推荐(0)
  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 谢晨锋 阅读(280) 评论(0) 推荐(0)
摘要: /** * 使用node连接mysql模块 */ //引入MySQL数据库 const mysql = require("mysql"); //创建一个mysql连接对象,连接是使用对象来连接数据库 let connection = mysql.createConnection({ host:"12 阅读全文
posted @ 2021-06-09 20:44 谢晨锋 阅读(516) 评论(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 谢晨锋 阅读(276) 评论(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 谢晨锋 阅读(120) 评论(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 谢晨锋 阅读(1075) 评论(0) 推荐(0)
摘要: 文件夹目录 连接数据库 const mongoose = require("mongoose"); mongoose.connect("mongodb://localhost:27017/school",{ useNewUrlParser: true, useUnifiedTopology: tru 阅读全文
posted @ 2021-06-09 19:39 谢晨锋 阅读(409) 评论(0) 推荐(0)
  2021年6月8日
摘要: 文件结构 一.使用mongoose连接MongoDB数据库 //引入mongoose数据库 const mongoose = require("mongoose"); //连接mongodb数据库 mongoose.connect("mongodb://localhost:27017/school" 阅读全文
posted @ 2021-06-08 20:57 谢晨锋 阅读(163) 评论(0) 推荐(0)
摘要: 应用中间件 /** * 应用中间件 * 1.应用中间件的作用一般用于对url的拦截 * 2.应用需要使用next对象中间件放行 * * 拓展:所有的中间件都使用了use,路由器也属于中间件的一种 */ const express = require("express"); const app = e 阅读全文
posted @ 2021-06-08 19:58 谢晨锋 阅读(236) 评论(0) 推荐(0)
上一页 1 ··· 14 15 16 17 18 19 20 21 22 ··· 35 下一页