official_dulin

Results 152 issues of official_dulin

![image](https://cloud.githubusercontent.com/assets/17866683/15138821/f5a022ca-16c4-11e6-93a8-b30954b0bae1.png) ![image](https://cloud.githubusercontent.com/assets/17866683/15138829/fc0fb256-16c4-11e6-8fcf-cf4a91ba4137.png) ![image](https://cloud.githubusercontent.com/assets/17866683/15138838/0aaaa80c-16c5-11e6-89fa-f1e721da6dc5.png) as you can see, my app did not open in `127.0.0.1:3000`, but I input the host, It will work

Doc: https://github.com/istanbuljs/nyc#using-include-and-exclude-arrays

I think your es6 demo is not work correct. ```js { test: /\.js$/, exclude: /node_modules/, include: [path.join(__dirname, 'src')], loader: 'babel', query: { presets: ['es2015'] } } ``` Above works fine.

Related issue: https://github.com/domenic/chai-as-promised/issues/169 `chai-as-promised` does not work with [Promise.delay](http://bluebirdjs.com/docs/api/promise.delay.html) API of bluebird. Mocha will give me timeout error: ```bash test 1) should work 0 passing (5s) 1 failing 1) test...

`shadowsocks`设置为: * 打开`shadowsocks` * 自动代理模式 * 服务器(香港阿里云) 以`zsh`作为说明 ```bash ➜ ~ vim ~/.zshrc ``` 添加如下代理配置: ```bash # proxy list alias proxy='export all_proxy=socks5://127.0.0.1:1080' alias unproxy='unset all_proxy' ``` `:wq`保存退出 ```bash ➜ ~...

shadowsocks
OSX
terminal

移动端chrome浏览器可以将当前访问的应用“添加到主屏幕”,这样桌面上就会出现一个应用快捷方式。 小米4手机chrome浏览器点击“添加到主屏幕”后,没有任何反应,桌面上也没有出现应用图标。 __解决方法:__ 设置 - 更多应用 - 在“全部”中找到Chrome - 权限管理 - 开启“桌面快捷方式”权限

chrome
Web Development

![Cover image](https://raw.githubusercontent.com/mrdulin/pic-bucket-01/master/CoverImage202108051649.png) ## 架构基于React Hooks和React FC设计: ![React&Redux application architecture](https://raw.githubusercontent.com/mrdulin/pic-bucket-01/2114bc7c8166c9ba66734202a5d40f8a907d89ec/React%26Redux%E5%BA%94%E7%94%A8%E6%9E%B6%E6%9E%84%E5%9B%BE%20.png) ## View层 React functional component构建视图,包含: - ReactElement,JSX视图元素 - 视图的事件处理函数,例如onClick等 - 使用controller层提供的hooks,获取View Model 使用组件内部state的视图逻辑通过custom hook封装,导出state和操作该state的函数,事件处理函数直接去调用custom hook导出的函数来变更视图state。 ## Controller层 主要使用React hooks来实现,包含 - 业务custom...

React
Redux
Web Development
architecture

`react-router` v4,我称之为“第四代react-router”,`react-router`和`react-router-dom`的区别是什么呢? 为什么有时候我们看到如下的写法: 写法1: ```js import {Switch, Route, Router, HashHistory, Link} from 'react-router-dom'; ``` 写法2: ```js import {Switch, Route, Router} from 'react-router'; import {HashHistory, Link} from 'react-router-dom'; ``` 先简单说下各自的功能: `react-router`:...

React
JavaScript

# 在GraphQL中实现用户认证和授权的5种方式 ### 前言 用户的认证和授权是大多数web服务具备的功能,对于提供RESTful API的web服务,以Node.js社区的web框架express.js为例,基本流程是将用户认证和授权的功能实现放在中间件(middleware)中,比如[express-jwt](https://github.com/auth0/express-jwt)中间件,使用基于JWT的用户认证,该中间件会验证和解析客户端发送的请求的请求头上设置的`Authorization: Bearer `字段,并将解析出来的用户信息设置在请求对象`req`上,在下一个中间件或者我们定义的路由controller中,可以拿到该用户信息,比如id和email,通过id或email查询数据库,从而获取用户角色role,进行权限验证。相关的文档已经很多,不再叙述。 这篇文章主要讲构建GraphQL Web服务时,由于其不同于传统RESTful API的路由和中间件定义方式,严格意义上没有路由的概念,所以技术实现上不同于使用RESTful架构风格构建的web服务。不过很多原理和思想依旧是想通的,希望这篇文章能给开发者们一个启发。 阅读本文需要熟练掌握以下编程技术,思想,模式: - Node.js,Express.js,TypeScript,JavaScript, apollographql,graphql - middleware, RESTful API架构风格, JWT - Decorator模式, mokeypatch, FP, OOP, high-order function(高阶函数) ### 解决方案 首先使用可视化工具给示例代码的GraphQL...

技术文档
编程
Node.js
GraphQL
Apollo GraphQL

# GraphQL Subscription 多用户订阅与通知(二) ### 问题 在上一篇文章中,讲解了如何使用`GraphQL` `Subscription`实现多用户订阅与通知,但是有个问题,我们是在单个服务器应用实例(instance)的基础上实现的,什么意思?来讲下,我们启动一个Node.js服务器应用,比如常见的使用`Express.js`, `Koa.js`创建的Web Server应用,计算机系统都会分配资源(CPU,内存等)给一个进程,然后我们的Web Server应用就运行在这个进程中。在上一篇文章中,是通过如下命令启动了一个实例的`GraphQL` web server: ```typescript ☁ apollo-graphql-tutorial [master] ⚡ npx ts-node src/subscriptions/main.ts 🚀 Server ready at http://localhost:3000/ 🚀 Subscriptions ready at...

技术文档
编程
Node.js
GraphQL
Apollo GraphQL