摘要:
process.env.NODE_ENV process对象是全局变量,它提供当前node.js的有关信息,以及控制当前node.js的有关进程。因为是全局变量,它对于node应用程序是始终可用的,无需require()。 NODE_ENV不是process.env对象上原有的属性,它是我们自己添加 阅读全文
摘要:
安装koa-session yarn add koa-session 配置koa-session redis const session = require('koa-session'); const Redis = require('ioredis'); const redis = new Red 阅读全文
摘要:
next使用 @zeit/next-css 支持import css 安装:npm install --save @zeit/next-css || yarn add @zeit/next-css配置: // next.config.js// next支持import css const withC 阅读全文
摘要:
一、安装 yarn add ioredis || cnpm i redis --save 二、使用 执行 node test.js // test.jsasync function test(){ const Redis=require('ioredis'); const redis = new R 阅读全文
摘要:
一、redis mac系统安装 1.下载解压安装。 首先进入redis官网直接下载。 解压后进入文件夹,执行 make 命令。 然后执行 sudo make install 命令。 安装成功。 2.使用homebrew安装。 执行 brew install redis 遇到问题先 brew upda 阅读全文
摘要:
接入github OAuth时序图 github oauth api地址 https://developer.github.com/apps/building-oauth-apps/authorizing-oauth-apps/ 1. 使用client_id scope等获取code。 浏览器输入: 阅读全文
摘要:
安装chrome扩展 安装redux-devtools-extension yarn add redux-devtools-extension --dev store.js import { composeWithDevTools } from 'redux-devtools-extension'; 阅读全文
摘要:
安装react-redux yarn add react-redux 引入Provider 传入store 类似context import {Provider} from 'react-redux' import store from '../store/store' render() { con 阅读全文
摘要:
安装redux redux-thunk yarn add redux redux-thunk 三个概念: store reducer action store createStore创建 getState()获取状态 dispatch(action)触发reducer更新 subscribe(()= 阅读全文