摘要:
https://www.bilibili.com/video/av50341412 阅读全文
posted @ 2020-02-07 07:14
''JoJo
阅读(985)
评论(0)
推荐(1)
摘要:
需要用到的插件有: npm i bcryptjs npm i jswebtoken 运行文件server.js const { User } = require('./models') const express = require('express') //引用 express const jwt 阅读全文
posted @ 2020-02-07 04:42
''JoJo
阅读(603)
评论(0)
推荐(0)
摘要:
### //delete请求 DELETE {{uri}}products/5e3c55760ee90c2240c8599e //删除数据和delete请求 app.delete('/products/:id',async function(req, res) { const product = a 阅读全文
posted @ 2020-02-07 02:24
''JoJo
阅读(503)
评论(0)
推荐(0)
摘要:
//修改产品数据和put请求 app.put('/products/:id',async function(req, res) { //查询需要修改的产品的id const product = await Product.findById(req.params.id) //将需要改的title替换 阅读全文
posted @ 2020-02-07 02:19
''JoJo
阅读(168)
评论(0)
推荐(0)
摘要:
安装vscode的 REST Client 插件 创建test.http文件使用 //定义变量 //请求之间需要使用三个#号隔开 ### @uri = http://localhost:3000/ ### //get请求 GET {{uri}}products ### GET {{uri}}prod 阅读全文
posted @ 2020-02-07 02:07
''JoJo
阅读(182)
评论(0)
推荐(0)
摘要:
//await 异步操作 //await 和 async成对出现//使用到Product都需要到异步操作//find() 用于查找所有数据 //下列所有方法使用都是在find() //limit(Number) 限制条数 //skip(Number) 条过数据,跳第几条就几 //where() 查询 阅读全文
posted @ 2020-02-07 01:45
''JoJo
阅读(127)
评论(0)
推荐(0)