上一页 1 ··· 3 4 5 6 7
摘要: req.fresh req.stale var version = 100; app.get('/test',function(req,res){ res.set('etag',version); if(req.fresh){ res.send(); }else{ res.send('version 阅读全文
posted @ 2018-05-13 21:21 甜珊贝奇 阅读(174) 评论(0) 推荐(0) 编辑
摘要: req.method -->GET req.hostname -->127.0.0.1 req.originalUrl -->/test/test/test?name=wang req.protocol -->http req.path -->/test/test/test req.params - 阅读全文
posted @ 2018-05-13 12:11 甜珊贝奇 阅读(256) 评论(0) 推荐(0) 编辑
摘要: const express= require('express'); const app = express(); app.use('/public',express.static(__dirname+'public')); 第一个参数:访问路径 ,第二个参数:静态资源路径 app.use('/pu 阅读全文
posted @ 2018-05-13 11:54 甜珊贝奇 阅读(130) 评论(0) 推荐(0) 编辑
摘要: /abc?d 表示c可有可无 /abc+d c至少出现一次或者多次,末尾必须有d /abc\*d c和d之间可以有任意多个字符,但是末尾必须有d /a(bc)?d bc可有可无 /a(bc)+d bc至少出现一次或者多次,末尾必须有d /\/ab[1,2]cd/ 正则匹配 ['abc?d','abc 阅读全文
posted @ 2018-05-13 10:13 甜珊贝奇 阅读(202) 评论(0) 推荐(0) 编辑
摘要: 设定编码格式:mysql -u root -p --default-character-set=utf8 use dbname source /root/newsdata.sql 阅读全文
posted @ 2018-05-09 13:38 甜珊贝奇 阅读(275) 评论(0) 推荐(0) 编辑
摘要: Waterline基本介绍 Waterline是什么 Waterline是下一代存储和检索引擎,也是Sails框架中使用的默认ORM 。 ORM的基本概念 Object Relational Mapping 将文档数据库中的一个文档,关系数据库表中的一行,映射为JavaScript中的一个对象 操作 阅读全文
posted @ 2018-05-03 10:32 甜珊贝奇 阅读(318) 评论(0) 推荐(0) 编辑
摘要: 模式的扩展 默认值 默认值的类型: 固定值、即使生成 代码展示: var mongoose = require('mongoose');mongoose.connect('mongodb://localhost/test1');var AppleSchema = new mongoose.Schem 阅读全文
posted @ 2018-05-02 10:17 甜珊贝奇 阅读(551) 评论(0) 推荐(0) 编辑
摘要: MongoDB运行的两种方式 检查是否有MongoDB:which mongod 创建数据库存储目录:mkdir -p /data/db 检查磁盘目录是否有空间(一般要大于4G):df -lh 启动:a直接启动:mongod --dbpath=/data/db --port=27017 b守护进程的 阅读全文
posted @ 2018-05-01 16:53 甜珊贝奇 阅读(257) 评论(0) 推荐(0) 编辑
上一页 1 ··· 3 4 5 6 7