-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathserverless.yml
103 lines (95 loc) · 2.49 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
service: document-api-example
provider:
name: aws
runtime: nodejs10.x
plugins:
- serverless-aws-documentation
custom:
documentation:
api:
info:
version: '1.0.0'
title: Document API Example
description: “Documentation is a love letter that you write to your future self.”
models:
-
name: "Hello"
description: "Hello post object"
contentType: "application/json"
schema:
type: "object"
properties:
name:
type: "string"
-
name: "HelloMessage"
description: "Hello post object"
contentType: "application/json"
schema:
type: "object"
properties:
message:
type: "string"
-
name: ErrorResponse
contentType: "application/json"
schema:
type: object
properties:
message:
type: string
statusCode:
type: number
functions:
get:
handler: handler.get
events:
- http:
path: hello
method: get
cors: true
documentation:
summary: "GET will say hi"
description: "Get hello from our GET endpoint"
tags:
- Hello
method: get
path: hello
methodResponses:
-
statusCode: "200"
responseModels:
"application/json": "HelloMessage"
-
statusCode: "500"
responseModels:
"application/json": "ErrorResponse"
post:
handler: handler.post
events:
- http:
path: hello
method: post
cors: true
documentation:
summary: "POST hello"
description: "POST will say hi to the name posted in body"
tags:
- Hello
method: get
path: hello
requestModels:
"application/json": "Hello"
methodResponses:
-
statusCode: "200"
responseModels:
"application/json": "HelloMessage"
-
statusCode: "400"
responseModels:
"application/json": "ErrorResponse"
-
statusCode: "500"
responseModels:
"application/json": "ErrorResponse"