first commit
This commit is contained in:
1
gateway/config/backup/.pydio
Normal file
1
gateway/config/backup/.pydio
Normal file
@@ -0,0 +1 @@
|
||||
da3d4927-dcc5-4dd3-b8e2-42b1cf9b5eaa
|
||||
80
gateway/config/backup/gateway.config.yml
Normal file
80
gateway/config/backup/gateway.config.yml
Normal file
@@ -0,0 +1,80 @@
|
||||
# https://www.express-gateway.io/docs/configuration/gateway.config.yml/
|
||||
# https://www.cnblogs.com/PLM-Teamcenter/p/16388583.html
|
||||
|
||||
http:
|
||||
port: 8080
|
||||
admin:
|
||||
port: 9876
|
||||
host: localhost
|
||||
# 指定具体的客户端 - 绑定域名和 被映射的接口地址
|
||||
apiEndpoints:
|
||||
api:
|
||||
host: localhost
|
||||
paths: '/ip'
|
||||
|
||||
user_client:
|
||||
host: localhost
|
||||
paths:
|
||||
- /user
|
||||
- /user/*
|
||||
|
||||
articles_client:
|
||||
host: localhost
|
||||
paths:
|
||||
- /articles
|
||||
- /articles/*
|
||||
|
||||
# 声明网关可以管理的微服务 - 被代理的地址
|
||||
serviceEndpoints:
|
||||
userbin:
|
||||
url: 'http://127.0.0.1:3002'
|
||||
|
||||
articlesbin:
|
||||
url: 'http://127.0.0.1:3003'
|
||||
|
||||
httpbin:
|
||||
url: 'https://httpbin.org'
|
||||
|
||||
policies:
|
||||
- basic-auth
|
||||
- cors
|
||||
- expression
|
||||
- key-auth
|
||||
- log
|
||||
- oauth2
|
||||
- proxy
|
||||
- rate-limit
|
||||
|
||||
# 通过管道把客户端与微服务串联起来
|
||||
pipelines:
|
||||
|
||||
default:
|
||||
apiEndpoints:
|
||||
- api
|
||||
policies:
|
||||
# Uncomment `key-auth:` when instructed to in the Getting Started guide.
|
||||
# - key-auth:
|
||||
# proxy;它的作用是代理/转发请求,这里指定了将 apiEndpoints 来的请求转发到前面定义了的微服务
|
||||
- proxy:
|
||||
- action:
|
||||
serviceEndpoint: httpbin
|
||||
changeOrigin: true
|
||||
|
||||
pipeline_user:
|
||||
apiEndpoints:
|
||||
- user_client
|
||||
policies:
|
||||
- proxy:
|
||||
- action:
|
||||
serviceEndpoint: userbin
|
||||
changeOrigin: true
|
||||
|
||||
pipeline_articles:
|
||||
apiEndpoints:
|
||||
- articles_client
|
||||
policies:
|
||||
- proxy:
|
||||
- action:
|
||||
serviceEndpoint: articlesbin
|
||||
changeOrigin: true
|
||||
|
||||
26
gateway/config/backup/system.config.yml
Normal file
26
gateway/config/backup/system.config.yml
Normal file
@@ -0,0 +1,26 @@
|
||||
# Core
|
||||
db:
|
||||
redis:
|
||||
emulate: true
|
||||
namespace: EG
|
||||
|
||||
#plugins:
|
||||
# express-gateway-plugin-example:
|
||||
# param1: 'param from system.config'
|
||||
|
||||
crypto:
|
||||
cipherKey: sensitiveKey
|
||||
algorithm: aes256
|
||||
saltRounds: 10
|
||||
|
||||
# OAuth2 Settings
|
||||
session:
|
||||
secret: keyboard cat
|
||||
resave: false
|
||||
saveUninitialized: false
|
||||
accessTokens:
|
||||
timeToExpiry: 7200000
|
||||
refreshTokens:
|
||||
timeToExpiry: 7200000
|
||||
authorizationCodes:
|
||||
timeToExpiry: 300000
|
||||
Reference in New Issue
Block a user