上一页 1 ··· 11 12 13 14 15 16 17 18 19 ··· 31 下一页
  2021年6月9日
摘要: 图片请求案例 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) 编辑
  2021年6月8日
摘要: 文件结构 一.使用mongoose连接MongoDB数据库 //引入mongoose数据库 const mongoose = require("mongoose"); //连接mongodb数据库 mongoose.connect("mongodb://localhost:27017/school" 阅读全文
posted @ 2021-06-08 20:57 文种玉 阅读(126) 评论(0) 推荐(0) 编辑
摘要: 应用中间件 /** * 应用中间件 * 1.应用中间件的作用一般用于对url的拦截 * 2.应用需要使用next对象中间件放行 * * 拓展:所有的中间件都使用了use,路由器也属于中间件的一种 */ const express = require("express"); const app = e 阅读全文
posted @ 2021-06-08 19:58 文种玉 阅读(201) 评论(0) 推荐(0) 编辑
摘要: 搭建用户路由器 概述,路由器的作用是将功能分类,比如将user下的所有功能,都放入user路由器下 举两个例子 用户路由器 localhost:8080/user/list /** * 请求的入口 */ const express = require("express"); const app = 阅读全文
posted @ 2021-06-08 19:36 文种玉 阅读(80) 评论(0) 推荐(1) 编辑
摘要: 方式一:通过绑定数据流data事件来获取 <!DOCTYPE html> <html lang="en"> <head> <meta charset="UTF-8"> <meta http-equiv="X-UA-Compatible" content="IE=edge"> <meta name=" 阅读全文
posted @ 2021-06-08 18:50 文种玉 阅读(1511) 评论(0) 推荐(0) 编辑
摘要: const express = require("express"); const app = express(); app.listen(8080); /** * 请求方式一 * http://localhost:8080/reg?username=zhangsan&password=123456 阅读全文
posted @ 2021-06-08 18:35 文种玉 阅读(373) 评论(0) 推荐(0) 编辑
摘要: const express = require("express"); //创建服务器 var app = express(); //配置服务器的端口 app.listen(8080); app.get("/login",(req,res)=>{ //普通响应 // res.end("今天天气好晴朗 阅读全文
posted @ 2021-06-08 18:25 文种玉 阅读(186) 评论(0) 推荐(0) 编辑
  2021年6月7日
摘要: npm config set registry https://registry.npm.taobao.org 可以直接使用 npm 来进行操作 阅读全文
posted @ 2021-06-07 18:58 文种玉 阅读(81) 评论(0) 推荐(0) 编辑
上一页 1 ··· 11 12 13 14 15 16 17 18 19 ··· 31 下一页