-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathserverless.yml
More file actions
119 lines (119 loc) · 3.31 KB
/
serverless.yml
File metadata and controls
119 lines (119 loc) · 3.31 KB
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
service: hiyoko-sensei
provider:
name: aws
runtime: nodejs8.10
stage: ${env:NODE_ENV} # Set the default stage used. Default is dev
region: ap-northeast-1 # Overwrite the default region used. Default is us-east-1
environment:
NODE_ENV: ${env:NODE_ENV}
LINE_BOT_ACCESS_TOKEN: ${env:LINE_BOT_ACCESS_TOKEN}
LINE_BOT_SECRET_TOKEN: ${env:LINE_BOT_SECRET_TOKEN}
CORE_URL: ${env:CORE_URL}
ADMIN_TOKEN: ${env:ADMIN_TOKEN}
plugins:
- serverless-plugin-typescript
- serverless-prune-plugin
functions:
# For bot
hiyokoSensei:
handler: src/hiyokoMantle/web/bot/index.handler
events:
- http:
path: hiyokoSensei/bot/webhook
method: post
# For add vocabulary
hiyokoSenseiLiff:
handler: src/hiyokoMantle/web/liff/vocabularyListAdd.handler
events:
- http:
path: hiyokoSensei/liff/vocabularyList/add
method: get
- http:
path: hiyokoSensei/liff/vocabularyList/add
method: post
# For list all user vocabularies
hiyokoSenseiLiff-Vocabularies:
handler: src/hiyokoMantle/web/liff/vocabularyLists.handler
events:
- http:
path: hiyokoSensei/liff/vocabularyLists/all
method: get
- http:
path: hiyokoSensei/api/vocabularyLists
method: get
- http:
path: hiyokoSensei/api/vocabularyLists
method: put
- http:
path: hiyokoSensei/api/vocabularyLists
method: delete
# For simple quizzes
hiyokoSenseiLiff-SimpleQuizzes:
handler: src/hiyokoMantle/web/liff/simpleQuizzes.handler
events:
- http:
path: hiyokoSensei/liff/quizzes/simple
method: get
- http:
path: hiyokoSensei/api/quizzes/simple
method: get
- http:
path: hiyokoSensei/api/quizzes/simple
method: post
# For composite quizzes
hiyokoSenseiLiff-CompositeQuizzes:
handler: src/hiyokoMantle/web/liff/compositeQuizzes.handler
events:
- http:
path: hiyokoSensei/liff/quizzes/composite
method: get
- http:
path: hiyokoSensei/api/quizzes/composite
method: get
- http:
path: hiyokoSensei/api/quizzes/composite
method: post
hiyokoSenseiLiff-UserSetting:
handler: src/hiyokoMantle/web/liff/userSetting.handler
events:
- http:
path: hiyokoSensei/liff/userSetting/home
method: get
- http:
path: hiyokoSensei/liff/userSetting/planning
method: get
- http:
path: hiyokoSensei/api/userSetting/planning/count
method: put
# For push message
# FIXME: This setting makes two pushers(DEV / PROD)
hiyokoSenseiPusher:
handler: src/hiyokoMantle/web/pusher/index.handler
events:
- http:
path: hiyokoSensei/pusher/message/users
method: post
cors: true
- http:
path: hiyokoSensei/pusher/message/users/all
method: post
cors: true
# For glosbe api
glosbe:
handler: src/hiyokoMantle/web/glosbe/glosbe.handler
events:
- http:
path: hiyokoSensei/glosbe/translate
method: get
package:
include:
- src/hiyokoMantle/web/liff/template
exclude:
- src/hiyokoCore
- build
- db
- prac
custom:
prune:
automatic: true
number: 3