05 2018 档案

摘要:步骤: 第一步:安装yarn 参考网址:https://yarn.bootcss.com/docs/install.html#linux-tab a.用pm2启动已创建的server.js #pm2 start server.js b.pm2查看服务 #pm2 show server c.pm2查看 阅读全文
posted @ 2018-05-18 14:03 jackliy 阅读(438) 评论(0) 推荐(0)
摘要:步骤://center os 上把apt-get换成yum 第一步:进入服务器升级工具包 sudo apt-get update 第二步:安装git sudo apt-get install git vim openssl build-essential lib ssh-dev wget curl 阅读全文
posted @ 2018-05-18 13:42 jackliy 阅读(1259) 评论(0) 推荐(0)
摘要:会话机制: 浏览器-->服务器 浏览器<--服务器 (产生一个会话id,保存在cookie中) 浏览器-->服务器(服务器根据会话id关联到相应数据信息体data) var express = require('express');var session = require('express-ses 阅读全文
posted @ 2018-05-15 22:56 jackliy 阅读(192) 评论(0) 推荐(0)
摘要:app.js var express = require('express');var app = express();app.use('/',require('./control'));app.use('/',require('./data'));app.use('/',require('./lo 阅读全文
posted @ 2018-05-15 21:22 jackliy 阅读(454) 评论(0) 推荐(0)
摘要:代码: const express = require('express'); const cookieParser = require('cookie-parser'); const app = express(); app.use(cookieParser()); //用于显示cookie ap 阅读全文
posted @ 2018-05-14 18:57 jackliy 阅读(134) 评论(0) 推荐(0)
摘要:代码: 'use strict' const express = require('express'); const consoldiate = require('consolidate'); const app = express(); app.engine('html',consoldiate. 阅读全文
posted @ 2018-05-14 17:40 jackliy 阅读(237) 评论(0) 推荐(0)
摘要:一共有4种解析方式 urlencoded、json、text 、raw 发起请求的form表单中可以设置三种数据编码方式 application/x-www-form-urlencoded、multipart/form-data、text/plain 异步请求可以设置 xhr.setRequestH 阅读全文
posted @ 2018-05-13 22:59 jackliy 阅读(763) 评论(0) 推荐(0)
摘要: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 jackliy 阅读(186) 评论(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 jackliy 阅读(266) 评论(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 jackliy 阅读(135) 评论(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 jackliy 阅读(217) 评论(0) 推荐(0)
摘要:设定编码格式:mysql -u root -p --default-character-set=utf8 use dbname source /root/newsdata.sql 阅读全文
posted @ 2018-05-09 13:38 jackliy 阅读(292) 评论(0) 推荐(0)
摘要:Waterline基本介绍 Waterline是什么 Waterline是下一代存储和检索引擎,也是Sails框架中使用的默认ORM 。 ORM的基本概念 Object Relational Mapping 将文档数据库中的一个文档,关系数据库表中的一行,映射为JavaScript中的一个对象 操作 阅读全文
posted @ 2018-05-03 10:32 jackliy 阅读(409) 评论(0) 推荐(0)
摘要:模式的扩展 默认值 默认值的类型: 固定值、即使生成 代码展示: var mongoose = require('mongoose');mongoose.connect('mongodb://localhost/test1');var AppleSchema = new mongoose.Schem 阅读全文
posted @ 2018-05-02 10:17 jackliy 阅读(577) 评论(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 jackliy 阅读(278) 评论(0) 推荐(0)