-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathserverless.yml
37 lines (34 loc) · 1001 Bytes
/
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
service: serverless-offline-mapping-templates
frameworkVersion: '2'
plugins:
- serverless-offline
provider:
name: aws
runtime: nodejs12.x
stage: dev
lambdaHashingVersion: 20201221
functions:
mainFunc:
handler: api/index.handler
memorySize: 128
events:
- http:
path: gettime
method: get
integration: lambda
request:
passThrough: NEVER
template:
application/json: '{ "triggerError" : "$input.params(''trigger_error'')" }'
response:
statusCodes:
200:
pattern: ''
headers:
Content-Type: "'application/json'"
template: '{ "output" : "Current time is $input.path(''$'').currentTime" }'
400:
pattern: '.*error.*'
headers:
Content-Type: "'application/json'"
template: '{ "output" : "Failed to get current time." }'