-
Notifications
You must be signed in to change notification settings - Fork 0
/
gateway.yml
48 lines (47 loc) · 1.14 KB
/
gateway.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
policyDefinitions:
cors:
origin: "http:https://localhost:3000"
rateLimit:
rateLimitBy: "jwt"
jwt:
secretOrPublicKey: "${JWT_SECRET}"
algorithms:
- "RS256"
endpoints:
- path: "/todos"
method: "GET"
destination:
url: "https://jsonplaceholder.typicode.com/todos"
headers:
- key: "Content-Type"
value: "application/json"
policies:
- cors
- rateLimit
- path: "/todos"
method: "POST"
destination:
url: "https://jsonplaceholder.typicode.com/todos"
headers:
- key: "Content-Type"
value: "application/json"
- key: "Authorization"
value: "Bearer ${AUTH_TOKEN}"
policies:
- cors
- path: "/giphy/trending"
method: "GET"
destination:
url: "https://api.giphy.com/v1/gifs/trending"
params:
- key: "api_key"
value: "${GIPHY_API_KEY}"
- key: "limit"
value: "1"
- path: "/spotify/artist"
method: "GET"
destination:
url: "https://api.spotify.com/v1/artists/4Z8W4fKeB5YxbusRsdQVPb"
headers:
- key: "Authorization"
value: "Bearer ${SPOTIFY_TOKEN}"