Cookie
Node.js 解析 cookie
Node.js 设置 cookie
Node.js 设置httpOnly 不允许前端 js 修改
session
使用 cookie 会暴露 username
session 使用
const SESSION_DATA={}
redis
session 问题
redis 特点
redis 安装与使用
安装
端口
brew install redis
redis-server 启动
新终端使用
redis-cli
set myname shuangyuelaoshi
get myname
keys *
del myname
使用
封装
调用
nginx 代理
nginx 介绍
nginx 命令
nginx 安装与下载
下载
brew install nginx
nginx 反向代理
配置
server{
listen 8080;
location /{
proxy_pass http://localhost:8001;
}
location /api{
proxy_pass http://localhost:8000;
proxy_set_header Host $host;
}
}