Ai
32 Star 117 Fork 28

来贝科技/微信API网关

加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
文件
克隆/下载
app_config.js.example 2.35 KB
一键复制 编辑 原始数据 按行查看 历史
老技 提交于 2025-11-15 14:41 +08:00 . refactor: optimize code
'use strict';
/**
* 应用配置
* Created by liamjung on 2018/5/28.
*/
module.exports = {
// 端口
port: 8080,
// 日志
log: {
// 根路径
rootPath: '/home/node/api-gateway',
// 追踪id键
traceIdKey: 'x-b3-traceid',
spanIdKey: 'x-b3-spanid',
parentSpanIdKey: 'x-b3-parentspanid',
},
// 运行模式,单机模式(standalone)、集群模式(cluster)
runningMode: 'standalone',
// 公众号配置名称(单机模式时,为配置文件名;集群模式时,为redis key)
mpConfigName: 'mp_config',
// redis配置(单机模式时,忽略;集群模式时,需配置)
redis: {
ip: '',
port: 6379,
pass: null,
},
// 插件配置
plugins: [
// 插件列表,配置顺序决定触发顺序
// 入口方法名称必须为main
{
// 日志追踪
path: '@libfintech/api-gateway-plugin/log_trace',
enable: true,
},
{
// ip
path: '@libfintech/api-gateway-plugin/ip',
config_path: '/plugin_config/ip',
enable: true,
},
{
// 认证
path: '@libfintech/api-gateway-plugin/authe',
config_path: '/plugin_config/authe',
enable: true,
},
{
// 微信网关
path: '@libfintech/api-gateway-plugin/wx_gateway',
config_path: '/plugin_config/wx_gateway',
enable: true,
},
{
// 转移请求
path: '@libfintech/api-gateway-plugin/transfer',
config_path: '/plugin_config/transfer',
enable: true,
},
{
// 反向代理
path: '@libfintech/api-gateway-plugin/proxy',
enable: true,
},
{
// 微信网关响应
path: '@libfintech/api-gateway-plugin/wx_gateway_response',
config_path: '/plugin_config/wx_gateway_response',
enable: true,
},
],
// 会话配置
session: {
// redis会话id前缀
// TODO 待扩展其他会话客户端(对应sso中的SessionClientTypeEnum)
sessionIdPrefix: 'sso:session:default:',
// redis账户id前缀
// TODO 待扩展其他会话客户端(对应sso中的SessionClientTypeEnum)
accountIdPrefix: 'sso:account:default:',
// http头中的会话key名称
// 不能有大写,客户端传值时,均转换为小写
sessionIdKeyName: 'authorization',
// 会话最长过期时间(一天),单位:秒
maxExpirationTime: 86400,
},
};
Loading...
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化
NodeJS
1
https://gitee.com/libfintech/wechat_api_gateway.git
git@gitee.com:libfintech/wechat_api_gateway.git
libfintech
wechat_api_gateway
微信API网关
master

搜索帮助