-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathserverless.yml
60 lines (53 loc) · 1.28 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
service: test-task-node
frameworkVersion: '3'
custom:
splitStacks:
perFunction: false
perType: false
perGroupFunction: true
nestedStackCount: 10
NODE_ENV: dev
MONGO_DB_URL: mongodb://localhost:27017/test
serverless-offline:
httpPort: 3001
serverless-offline-watcher:
- path:
- src/**/*.js
command: echo "js file in function folder was modified!"
provider:
name: aws
region: eu-north-1
runtime: nodejs20.x
lambdaHashingVersion: 20201221
versionFunctions: false
environment:
MONGO_DB_URL: ${self:custom.MONGO_DB_URL}
plugins:
- serverless-offline
- serverless-offline-watcher
- serverless-plugin-split-stacks
functions:
testApi:
timeout: 30 # With cold starts this endpoint can be slow
memorySize: 512 # default is 1024
handler: src/functions/test.handler
reservedConcurrency: 4
events:
- http:
path: '/test'
method: get
cors:
origin: '*'
allowCredentials: false
getWeather:
handler: src/functions/weatherHandler.getWeather
events:
- http:
path: api/weather
method: get
togglePin:
handler: src/functions/weatherHandler.togglePin
events:
- http:
path: api/weather/togglePin
method: post