-
Notifications
You must be signed in to change notification settings - Fork 1
/
serverless.yml
259 lines (254 loc) · 6.06 KB
/
serverless.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
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
service: slr-backend
frameworkVersion: ">=1.1.0 <2.0.0"
plugins:
- serverless-python-requirements
provider:
name: aws
runtime: python3.8
region: eu-central-1
timeout: 15
environment:
MONGO_DB_ENV: ${env:MONGO_DB_ENV}
MONGO_DB_USER: ${env:MONGO_DB_USER}
MONGO_DB_PASS: ${env:MONGO_DB_PASS}
MONGO_DB_URL: ${env:MONGO_DB_URL}
SPRINGER_API_KEY: ${env:SPRINGER_API_KEY}
ELSEVIER_API_KEY: ${env:ELSEVIER_API_KEY}
JWT_SECRET_KEY: ${env:JWT_SECRET_KEY}
iamManagedPolicies:
- "arn:aws:iam::aws:policy/service-role/AWSLambdaBasicExecutionRole"
functions:
dry_query:
handler: handler.dry_query
events:
- http:
path: query
method: post
cors: true
new_query:
handler: handler.new_query
events:
- http:
path: review/{review_id}/query
method: post
cors: true
request:
parameters:
path:
review_id: true
get_persisted_results:
handler: handler.get_persisted_results
events:
- http:
path: results/{review_id}
method: get
cors: true
request:
parameters:
querystrings:
page: false
page_length: false
paths:
review_id: true
persist_pages_of_query:
handler: handler.persist_pages_of_query
events:
- http:
path: persist/{review_id}
method: post
cors: true
request:
parameters:
# querystrings:
# query_id: true
paths:
review_id: true
add_collaborator_to_review:
handler: handler.add_collaborator_to_review
events:
- http:
path: review/{review_id}/collaborator
method: post
cors: true
request:
parameters:
querystrings:
username: true
paths:
review_id: true
get_reviews_for_user:
handler: handler.get_reviews_for_user
events:
- http:
path: users/{username}/reviews
method: get
cors: true
request:
parameters:
querystrings:
username: true
persist_list_of_results:
handler: handler.persist_list_of_results
events:
- http:
path: persist/{review_id}/list
method: post
cors: true
request:
parameters:
# querystrings:
# query_id: true
paths:
review_id: true
delete_results_by_dois:
handler: handler.delete_results_by_dois
events:
- http:
path: persist/{review_id}
method: delete
cors: true
request:
parameters:
paths:
review_id: true
add_review:
handler: handler.add_review
events:
- http:
path: review
method: post
cors:
origin: '*'
get_review_by_id:
handler: handler.get_review_by_id
events:
- http:
path: review/{review_id}
method: get
request:
parameters:
paths:
review_id: true
cors:
origin: '*'
delete_review:
handler: handler.delete_review
events:
- http:
path: review/{review_id}
method: delete
request:
parameters:
paths:
review_id: true
cors:
origin: '*'
update_review:
handler: handler.update_review
events:
- http:
path: review/{review_id}
method: put
request:
parameters:
paths:
review_id: true
cors:
origin: '*'
add_user:
handler: handler.add_user_handler
events:
- http:
path: users
method: post
cors: true
get_user_by_username:
handler: handler.get_user_by_username_handler
events:
- http:
path: users/{username}
method: get
cors: true
request:
parameters:
paths:
username: true
get_users:
handler: handler.get_all_users_handler
events:
- http:
path: users
method: get
cors: true
update_user:
handler: handler.update_user_handler
events:
- http:
path: user
method: patch
cors: true
add_api_keys:
handler: handler.add_api_key_to_user_handler
events:
- http:
path: userdb
method: post
cors: true
delete_user:
handler: handler.delete_user_handler
events:
- http:
path: users/{username}
method: delete
cors: true
request:
parameters:
paths:
username: true
login:
handler: handler.login_handler
events:
- http:
path: login
method: post
cors: true
logout:
handler: handler.logout_handler
events:
- http:
path: logout
method: delete
cors: true
check_auth:
handler: handler.check_jwt_handler
events:
- http:
path: logincheck
method: post
cors: true
update_score:
handler: handler.update_score
events:
- http:
path: score/{review_id}
method: post
cors: true
request:
parameters:
querystrings:
doi: true
paths:
review_id: true
# https://www.serverless.com/framework/docs/providers/aws/events/apigateway#request-parameters cors: true
# sample_handler:
# handler: handler.sample_handler
# events:
# - http:
# path: query/{my_path_param}
# method: post
# request:
# parameters:
# querystrings:
# my_query_string: false
# paths:
# my_path_param: true