# koa2-blog0728 **Repository Path**: li-lihong571/koa2-blog0728 ## Basic Information - **Project Name**: koa2-blog0728 - **Description**: No description available - **Primary Language**: Unknown - **License**: Not specified - **Default Branch**: master - **Homepage**: None - **GVP Project**: No ## Statistics - **Stars**: 0 - **Forks**: 0 - **Created**: 2021-07-28 - **Last Updated**: 2021-07-28 ## Categories & Tags **Categories**: Uncategorized **Tags**: None ## README const session = require('koa-generic-session') const redisStore = require('koa-redis') const { REDIS_CONF } = require('./config/db') app.keys = ['okeKhSIksdf_+%'] app.use(session({ cookie: { path: '/', httpOnly: true, maxAge: 200 * 1000 }, store: redisStore({ all: `${REDIS_CONF.host}:${REDIS_CONF.port}` }) })) npm install koa --save -g npm install koa-generator -g 在代码目录里执行命令: koa2 文件名 在redis安装的目录执行命令 redis-server.exe redis.windows.conf redis-cli.exe -h 127.0.0.1 -p 6379 set myKey abc get myKey