随笔分类 -  Express

摘要:通过应用生成器工具 express-generator 可以快速创建一个应用的骨架。 express-generator 包含了 express 命令行工具。通过如下命令即可安装: -h 参数可以列出所有可用的命令行参数: 例如,如下命令创建了一个名称为 myapp 的 Express 应用。此应用 阅读全文
posted @ 2019-11-01 20:11 武卡卡 阅读(260) 评论(0) 推荐(0) 编辑
摘要:1,cnpm i express -g 2, cnpm i express-generater -g 3, express - e 项目名 阅读全文
posted @ 2019-10-29 14:01 武卡卡 阅读(421) 评论(0) 推荐(0) 编辑
摘要:mongoose.set('useCreateIndex', true) // 加上这个 阅读全文
posted @ 2019-09-19 08:44 武卡卡 阅读(529) 评论(0) 推荐(0) 编辑
摘要:1.安装bcryptjs模块 2.在需要加密的模块中引入bcryptjs库 require('bcryptjs'); 实战 : /** * 定义数据库模型 */ const userSchema = new mongoose.Schema({ username:{ type:String, uniq 阅读全文
posted @ 2019-09-07 21:54 武卡卡 阅读(1361) 评论(3) 推荐(2) 编辑
摘要:一,获取 get 提交的参数 var id = req.query.id || '' 二,获取 post 提交的参数 var name = req.body.name || '' 阅读全文
posted @ 2019-06-16 16:21 武卡卡 阅读(290) 评论(0) 推荐(0) 编辑

喜欢请打赏

扫描二维码打赏

支付宝打赏

点击右上角即可分享
微信分享提示