node
追寻着星星的方向
这个作者很懒,什么都没留下…
展开
-
express实现跨域+axios带cookie请求
axios:axios.create({ baseURL: "http://localhost:5000/api",//服务端地址 withCredentials: true})//或者axios.get("/test",{withCredentials:true})后端//在路由之前添加app.all("*", (req, res, next) => { r...原创 2019-10-30 13:24:03 · 460 阅读 · 0 评论 -
express 常用中间件
cors: 允许跨域原创 2019-10-21 21:50:05 · 111 阅读 · 0 评论 -
mongoose配置关联查询(个人笔记,非教程)
model/item.jsconst mongoose = require("../index.js");const CategorySchema = mongoose.Schema({ name: String, parentId: { type: mongoose.SchemaTypes.ObjectId, ref: "Category" //关联到Categro...原创 2019-10-13 09:15:46 · 390 阅读 · 0 评论