generated from defi-org-code/serverless-template
-
Notifications
You must be signed in to change notification settings - Fork 0
/
serverless.yml
157 lines (153 loc) · 4.55 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
service: ${env:GITHUB_REPO_NAME}
custom:
PROJECT: Twitter DEFI trend functions
provider: ${file(./serverless-provider.yml)}
package:
patterns:
- '!*'
- '!*/**'
- 'dist/*'
- 'dist/*/**'
functions:
###### Writers ######
writer_saveTopEntitiesByAll:
handler: dist/index.writer_saveTopEntitiesByAll
fileSystemConfig: ${file(./serverless-fs.yml)}
timeout: 60
events:
- schedule: rate(2 minutes) # examples: rate(1 minute), rate(60 minutes)
writer_saveTopEntByAllNoRetweets:
handler: dist/index.writer_saveTopEntitiesByAllWithoutRetweets
fileSystemConfig: ${file(./serverless-fs.yml)}
timeout: 60
events:
- schedule: rate(2 minutes) # examples: rate(1 minute), rate(60 minutes)
writer_saveTopEntitiesByList:
handler: dist/index.writer_saveTopEntitiesByList
fileSystemConfig: ${file(./serverless-fs.yml)}
timeout: 60
events:
- schedule:
rate: rate(1 minute) # examples: rate(1 minute), rate(60 minutes)
enabled: true
input:
pathParameters:
listId: "1413118800363458560"
###
writer_savePeriodTopEntities:
handler: dist/index.writer_cleanAndSavePeriodTopEntities
fileSystemConfig: ${file(./serverless-fs.yml)}
timeout: 60
events:
- schedule: cron(59 23 * * ? *)
writer_savePeriodTopEntNoRetweets:
handler: dist/index.writer_cleanAndSavePeriodTopEntitiesWithoutRetweets
fileSystemConfig: ${file(./serverless-fs.yml)}
timeout: 60
events:
- schedule: cron(59 23 * * ? *)
writer_savePeriodTopEnOfList:
handler: dist/index.writer_cleanAndSavePeriodTopEntitiesOfList
fileSystemConfig: ${file(./serverless-fs.yml)}
timeout: 60
events:
- schedule:
rate: cron(59 23 * * ? *)
enabled: true
input:
pathParameters:
listId: "1413118800363458560"
###
writer_cleanDB:
handler: dist/index.writer_cleanDB
fileSystemConfig: ${file(./serverless-fs.yml)}
timeout: 60
events:
- http:
path: cleanDB/{param}/{secret}/{listId}
method: get
cors: true
- http:
path: cleanDB/{param}/{secret}
method: get
cors: true
###### Readers ######
reader_fetchTopEntities:
handler: dist/index.reader_fetchTopEntities
fileSystemConfig: ${file(./serverless-fs.yml)}
events:
- http:
path: fetchTopEntities
method: get
cors: true
reader_fetchTopEntNoRetweets:
handler: dist/index.reader_fetchTopEntitiesWithoutRetweets
fileSystemConfig: ${file(./serverless-fs.yml)}
events:
- http:
path: fetchTopEntitiesWithoutRetweets
method: get
cors: true
reader_fetchTopEntitiesOfList:
handler: dist/index.reader_fetchTopEntitiesOfList
fileSystemConfig: ${file(./serverless-fs.yml)}
events:
- http:
path: fetchTopEntitiesOfList/{listId}
method: get
cors: true
##
reader_fetchActiveUsersOfList:
handler: dist/index.reader_fetchActiveUsersOfList
fileSystemConfig: ${file(./serverless-fs.yml)}
events:
- http:
path: fetchActiveUsersOfList/{listId}
method: get
cors: true
##
reader_fetchPeriodTopEntities:
handler: dist/index.reader_fetchPeriodTopEntities
fileSystemConfig: ${file(./serverless-fs.yml)}
events:
- http:
path: fetchPeriodTopEntities
method: get
cors: true
reader_fetchPeriodTopEntNoRetweets:
handler: dist/index.reader_fetchPeriodTopEntitiesWithoutRetweets
fileSystemConfig: ${file(./serverless-fs.yml)}
events:
- http:
path: fetchPeriodTopEntitiesWithoutRetweets
method: get
cors: true
reader_fetchPeriodTopEntitiesOfList:
handler: dist/index.reader_fetchPeriodTopEntitiesOfList
fileSystemConfig: ${file(./serverless-fs.yml)}
events:
- http:
path: fetchPeriodTopEntitiesOfList/{listId}
method: get
cors: true
##
reader_fetchTweetsByTag:
handler: dist/index.reader_fetchTweetsByTag
fileSystemConfig: ${file(./serverless-fs.yml)}
events:
- http:
path: fetchTweetsByTag/{filter}/{sinceId}
request:
parameters:
querystrings:
withoutRetweets: false
method: get
cors: true
- http:
path: fetchTweetsByTag/{filter}
request:
parameters:
querystrings:
withoutRetweets: false
method: get
cors: true