6b8500ac5e
CI / changes (push) Successful in 1m29s
CI / ad (push) Successful in 0s
CI / admin (push) Successful in 0s
CI / bff (push) Successful in 29s
CI / chore (push) Successful in 0s
CI / equipment (push) Successful in 0s
CI / express (push) Successful in 0s
CI / factory (push) Successful in 0s
CI / message (push) Successful in 1s
CI / order (push) Successful in 0s
CI / payment (push) Successful in 0s
CI / product (push) Successful in 1s
CI / record (push) Successful in 0s
CI / sale (push) Successful in 20s
CI / support (push) Successful in 1s
CI / task (push) Successful in 0s
CI / user (push) Successful in 0s
CI / wecom (push) Successful in 1s
54 lines
1.3 KiB
YAML
54 lines
1.3 KiB
YAML
plugin_configs:
|
|
- id: 1
|
|
plugins:
|
|
serverless-pre-function:
|
|
phase: access
|
|
functions:
|
|
- |
|
|
local f = assert(loadfile("/usr/local/apisix/auth.lua"))
|
|
local mod = f()
|
|
return mod.access
|
|
routes:
|
|
- id: bff-api
|
|
name: bff-api
|
|
priority: 10
|
|
uris:
|
|
- /admin/*
|
|
- /api/*
|
|
methods:
|
|
- GET
|
|
- POST
|
|
- PUT
|
|
- OPTIONS
|
|
plugin_config_id: 1
|
|
plugins:
|
|
cors:
|
|
allow_origins: "*"
|
|
allow_methods: "GET,POST,PUT,OPTIONS"
|
|
allow_headers: "Authorization,Authorization-Type,Authorization-Auth,Refresh,X-Refresh,X-Service-Code,Sec-WebSocket-Key,Sec-WebSocket-Version,Sec-WebSocket-Accept,Connection,Upgrade"
|
|
max_age: 86400
|
|
upstream:
|
|
type: roundrobin
|
|
nodes:
|
|
"bff:10000": 1
|
|
|
|
- id: bff-ws
|
|
name: bff-ws
|
|
priority: 20
|
|
uris:
|
|
- /ws/*
|
|
methods:
|
|
- GET
|
|
enable_websocket: true # 放到route顶层,不在plugins内部!
|
|
plugins:
|
|
cors:
|
|
allow_origins: "*"
|
|
allow_methods: "GET"
|
|
allow_headers: "Authorization,Authorization-Type,Authorization-Auth,Refresh,X-Refresh,X-Service-Code,Sec-WebSocket-Key,Sec-WebSocket-Version,Sec-WebSocket-Accept,Connection,Upgrade"
|
|
max_age: 86400
|
|
upstream:
|
|
type: roundrobin
|
|
nodes:
|
|
"bff:10001": 1
|
|
#END
|