08 2021 档案
摘要:先安装 npm i -D @types/node 在tsconfig.json配置中 添加 { "compilerOptions": { "types": ["node"] }, }
阅读全文
摘要:踩坑 用replaceall进行字符替换时发布至服务器发现replaceall报错不是一个方法 这里可以用replace加正则来解决 replace(/查询的内容/g,"修改的内容")
阅读全文
摘要:const Sequelize = require('sequelize'); const Op = Sequelize.Op; //在where查询条件中 where:{ name:{ [Op.like]:'%'+req.query.name+'%' } } [Op.and]: {a: 5} //
阅读全文
摘要:随着express升级,bodyParser从express中被分离了出来,因此,在使用express新版本的时候,需要npm install body-parser 来安装bodyParser。 在app.js中引用 var bodyParser = require('body-parser')
阅读全文