-
Notifications
You must be signed in to change notification settings - Fork 0
/
serverless.yml
128 lines (122 loc) · 3.36 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
service: wifactoryiot-accountmgt-swagger
provider:
name: aws
runtime: nodejs8.10
stage: dev
region: ap-northeast-1
role: arn:aws:iam::168124947308:role/iot-common-platform-builder-api-dev-ap-northeast-1-lambdaRole
plugins:
- serverless-webpack
- serverless-offline
- serverless-openapi-documentation
custom:
stage: ${opt:stage, self:provider.stage}
webpack:
webpackConfig: ./webpack.config.js
includeModules: true
documentation: ${file(ymls/swagger/documentation.yml):Documentation}
commonModelSchemaFragments:
# defining common fragments means you can reference them with a single line
MethodResponse200Json:
statusCode: '200'
responseModels:
"application/json": 200JsonResponse
MethodResponse400Json:
statusCode: '400'
responseModels:
"application/json": 400JsonResponse
MethodResponse502Json:
statusCode: '502'
responseModels:
"application/json": 502JsonResponse
functions:
UserLogin:
handler: userAction.login
events:
- http:
path: accounts/login
method: post
cors: true
documentation:
${file(ymls/swagger/UserLogin.yml):Documentation}
UserLogout:
handler: userAction.logout
events:
- http:
path: accounts/logout
method: post
cors: true
documentation:
${file(ymls/swagger/UserLogout.yml):Documentation}
ListRoles:
handler: accountRole.listRole
events:
- http:
path: roles
method: get
cors: true
documentation:
${file(ymls/swagger/RoleList.yml):Documentation}
FindRole:
handler: accountRole.findRole
events:
- http:
path: roles/{role_id}
method: get
cors: true
documentation:
${file(ymls/swagger/RoleFind.yml):Documentation}
ListAccount:
handler: accountMgt.listAccount
events:
- http:
path: accounts
method: get
cors: true
documentation:
${file(ymls/swagger/AccountList.yml):Documentation}
FindAccountByRoleId:
handler: accountMgt.findRoleAccount
events:
- http:
path: accounts/byRole/{role_id}
method: get
cors: true
documentation:
${file(ymls/swagger/AccountFindByRoleId.yml):Documentation}
FindAccountById:
handler: accountMgt.findUserAccount
events:
- http:
path: accounts/{user_id}
method: get
cors: true
documentation:
${file(ymls/swagger/AccountFindById.yml):Documentation}
CreateAccount:
handler: accountMgt.createAccount
events:
- http:
path: accounts
method: post
cors: true
documentation:
${file(ymls/swagger/AccountCreate.yml):Documentation}
UpdateAccount:
handler: accountMgt.updateAccount
events:
- http:
path: accounts/{user_id}
method: put
cors: true
documentation:
${file(ymls/swagger/AccountUpdate.yml):Documentation}
DeleteAccount:
handler: accountMgt.deleteAccount
events:
- http:
path: accounts/{user_id}
method: delete
cors: true
documentation:
${file(ymls/swagger/AccountDelete.yml):Documentation}