摘要: 使用app.listen,而不使用server.listen var express = require('express'); var app = express(); app.listen(4000, function(){ console.log("listening on port 4000 阅读全文
posted @ 2019-10-11 17:08 Mr_Kahn 阅读(667) 评论(0) 推荐(0)
摘要: 使用require,暂不支持import写法 另外,在主进程中 new BrowserWindow({ webPreferences: { nodeInteration: true } }) 阅读全文
posted @ 2019-10-09 16:36 Mr_Kahn 阅读(2215) 评论(2) 推荐(0)
摘要: 一般的项目采用的bodyParser对请求包进行解析,默认支持 application/json, application/x-www-form-urlencoded, 以及 multipart/form-data。 是不支持xml格式的请求包进行解析的,可以采用 application/json 阅读全文
posted @ 2019-09-12 14:45 Mr_Kahn 阅读(3122) 评论(0) 推荐(1)
摘要: 安装nodejs时,默认将路径添加到环境变量中,如果执行bat中的node命令报错“找不到node”,可能path环境变量中的路径不对,查看路径后面是否多了一个 \ 删掉后,检查bat能否正常执行 阅读全文
posted @ 2019-08-20 15:49 Mr_Kahn 阅读(1052) 评论(0) 推荐(0)
摘要: 使用Mongoose库 var Schema = new Schema({ time: { type: Date, default: Date.now(), expires: '300' //string,以秒为单位 } }) 非mongoose版: db.collection_name.creat 阅读全文
posted @ 2019-07-27 13:09 Mr_Kahn 阅读(621) 评论(0) 推荐(0)