作者:yanyige | 发布时间:2017-04-12 09:49

第四天

9时57分 第一节课 前端 梁超(LC)

前端的演进

业务的演进

业务特性

演化进程

个性化需求成为趋势(服务动态化) –> 网络劫持增多一度达到5(全站https)

服务动态化

全国多机房 + 海外机房

机房内部

负载均衡 + https代理集群 + http服务集群

用户访问路径

DNS分省运营商线路解析 + 负载均衡 + https代理服务 + http真实服务

HTTP服务组成

Nginx + Lua HTTP Server
|
|
Go Dynamic Service
|
|
Static Data Store————Static Data Generator

动静结合

Go Dynamic Service

遇到了什么问题

优化思路

重新定义发布流程

性能保障

例子: 360娱乐

技术选型

前端: Vue + webpack 后端: Nginx + Koa + Middlewares + Docker

服务端: Nginx + Go + Docker

分析现状,定义角色

14时00分 第二节课 NodeJS lizheming

课堂链接
https://ppt.baomitu.com/d/0f4500f7#/11

NPM scripts

dependencies

dependencies
发布后需要安装的模块

devDependencies
自己需要用的模块

peerDependencies
依赖的模块

bundledDenpendencies
捆绑依赖

optionalDenpendencies
可选依赖

semver version

http://semver.org/lang/zh-CN/

bin

"bin": {
    "test": "echo 123",
},

通过test执行这个脚本

registry

淘宝源

NPM的问题?

https://yarnpkg.com

制作、发布模块

-npm login -npm logout -npm publish -npm unpublish

练习 url: http://hitokoto.us/api.html

npm install request-promise-native registry=http://np
npm install --save // 保存到dependencies
const request = require(request-promise-native);

module.exports = function() {
    request.get({
        uri:
        json: true
    }).then(resp => resp.hitokoto);
}

更新模块

一个好的模块

npm能做什么?

CLI Web GUI loT Image Processing RealTime

- CLI: https://github.com/tj/commander.js
- GUI: https://electron.atom.io/
- IoT: https://www.h5jun.com/post/raspberry-pi.html
- Spider: PhantomJS / ScaperJS / Chromium

RESTful接口规范

Module自动更新

NodeJS调试

https://thinkjs.org/zh-cn/doc/2.2/debug.html