摘要: process.env.NODE_ENV process对象是全局变量,它提供当前node.js的有关信息,以及控制当前node.js的有关进程。因为是全局变量,它对于node应用程序是始终可用的,无需require()。 NODE_ENV不是process.env对象上原有的属性,它是我们自己添加 阅读全文
posted @ 2020-02-17 17:23 空船 阅读(1913) 评论(0) 推荐(0) 编辑
摘要: 安装koa-session yarn add koa-session 配置koa-session redis const session = require('koa-session'); const Redis = require('ioredis'); const redis = new Red 阅读全文
posted @ 2020-01-17 11:37 空船 阅读(482) 评论(0) 推荐(0) 编辑
摘要: 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 阅读全文
posted @ 2020-01-15 15:55 空船 阅读(1289) 评论(0) 推荐(0) 编辑
摘要: 一、安装 yarn add ioredis || cnpm i redis --save 二、使用 执行 node test.js // test.jsasync function test(){ const Redis=require('ioredis'); const redis = new R 阅读全文
posted @ 2020-01-15 15:30 空船 阅读(1896) 评论(0) 推荐(0) 编辑
摘要: 一、redis mac系统安装 1.下载解压安装。 首先进入redis官网直接下载。 解压后进入文件夹,执行 make 命令。 然后执行 sudo make install 命令。 安装成功。 2.使用homebrew安装。 执行 brew install redis 遇到问题先 brew upda 阅读全文
posted @ 2020-01-15 14:05 空船 阅读(417) 评论(0) 推荐(0) 编辑
摘要: 接入github OAuth时序图 github oauth api地址 https://developer.github.com/apps/building-oauth-apps/authorizing-oauth-apps/ 1. 使用client_id scope等获取code。 浏览器输入: 阅读全文
posted @ 2020-01-10 14:43 空船 阅读(535) 评论(0) 推荐(0) 编辑
摘要: 阅读全文
posted @ 2020-01-09 13:52 空船 阅读(226) 评论(0) 推荐(0) 编辑
摘要: 安装chrome扩展 安装redux-devtools-extension yarn add redux-devtools-extension --dev store.js import { composeWithDevTools } from 'redux-devtools-extension'; 阅读全文
posted @ 2020-01-08 05:16 空船 阅读(360) 评论(0) 推荐(0) 编辑
摘要: 安装react-redux yarn add react-redux 引入Provider 传入store 类似context import {Provider} from 'react-redux' import store from '../store/store' render() { con 阅读全文
posted @ 2020-01-08 04:54 空船 阅读(431) 评论(0) 推荐(0) 编辑
摘要: 安装redux redux-thunk yarn add redux redux-thunk 三个概念: store reducer action store createStore创建 getState()获取状态 dispatch(action)触发reducer更新 subscribe(()= 阅读全文
posted @ 2020-01-08 04:07 空船 阅读(184) 评论(0) 推荐(0) 编辑