-
Notifications
You must be signed in to change notification settings - Fork 0
/
example.serverless.yml
101 lines (97 loc) · 2.5 KB
/
example.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
service: aws-cron
frameworkVersion: "3"
provider:
name: aws
runtime: nodejs20.x
region: ap-south-1
memorySize: 1024 # repository wide Lambda memory size
stage: dev
timeout: 30 # repository wide Lambda timeout
environment: # repository wide Lambda env variables
NODE_ENV: production
# AWS_REG: xxxx ( aws region )
# AWS_ACC_KEY_ID: xxxx ( aws access key )
# AWS_SEC_ACCESS_KEY: xxxx ( aws secret access key )
WORKER_LAMBDA_ARN: arn:aws:lambda:xxxx
DATABASE_URL: libsql://xxxx
DATABASE_AUTH_TOKEN: xxxx
plugins:
- serverless-esbuild # used for compiling/packaging the Typescript code
- serverless-offline # used for local execution
custom:
esbuild:
bundle: true
minify: false
sourcemap: true
exclude: [] # If you using Node.js 18 Exclude AWS SDK as it is already available in the AWS environment. If you are using Node.js 20, make this empty.
target: "node20" # Node.js version must match your runtime
define: { "require.resolve": "undefined" }
platform: "node"
concurrency: 10
functions:
app:
handler: src/app.handler
events:
- http:
path: /
method: any
cors: true
# Project APIs
createProject:
handler: handler.createProject
events:
- http:
path: projects
method: post
cors: true
updateProject:
handler: handler.updateProject
events:
- http:
path: projects/{project_id}
method: put
cors: true
listProjects:
handler: handler.listProjects
events:
- http:
path: projects
method: get
cors: true
# Webhook APIs
executeWebhook:
handler: handler.executeWebhook
events:
- http:
path: webhook
method: post
cors: true
# Schedule APIs
createSchedule:
handler: handler.createSchedule
events:
- http:
path: projects/{project_id}/schedules
method: post
cors: true
listSchedules:
handler: handler.listSchedules
events:
- http:
path: projects/{project_id}/schedules
method: get
cors: true
updateSchedule:
handler: handler.updateSchedule
events:
- http:
path: projects/{project_id}/schedules/{schedule_id}
method: put
cors: true
deleteSchedule:
handler: handler.deleteSchedule
events:
- http:
path: projects/{project_id}/schedules/{schedule_id}
method: delete
cors: true