-
Notifications
You must be signed in to change notification settings - Fork 0
/
serverless.yml
83 lines (73 loc) · 1.75 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
## Serverless config
## https://serverless.com/framework/docs
## Name for overall service (collection of functions)
service: canteenbot
## AWS details
provider:
name: aws
runtime: nodejs8.10
region: ${opt:region, self:custom.region}
stage: ${opt:stage, self:custom.stage}
profile: ${opt:profile}
deploymentBucket: ${opt:deploymentBucket}
## Service-wide environment variables
environment:
ENV: ${opt:stage, self:custom.stage}
CORE_URL: ${file(env.yml):CORE_URL}
CLIENT_ID: ${file(env.yml):CLIENT_ID}
CLIENT_SECRET: ${file(env.yml):CLIENT_SECRET}
REDIRECT_URI: ${file(env.yml):REDIRECT_URI}
CANTEEN_URL: ${file(env.yml):CANTEEN_URL}
DATA_BUCKET_NAME: ${file(env.yml):DATA_BUCKET_NAME}
custom:
region: eu-west-1
stage: dev
## Individual parts of the service
functions:
## CanteenBot's core
core:
handler: core/handler.handler
events:
- http:
path: /core
method: get
environment:
DATA_URL: https://canteenbot-data.s3-eu-west-2.amazonaws.com/
## Slash-command listener
slack:
handler: slack/handler.handler
events:
- http:
method: get
path: /slack
- http:
method: post
path: /slack
## Post to Slack on a schedule
- schedule:
rate: cron(0 10 * * ? *)
input:
notify: true
## Alexa skill
# alexa:
# handler: alexa/handler.handler
# events:
# - alexaSkill
## Menu scraper
scraper:
handler: scraper/handler.handler
events:
- schedule: cron(0 * * * ? *)
## Bundling options
package:
# individually: true
exclude:
- assets/**
- data/**
- package.json
- .gitignore
- README.md
# include:
# lib/**
plugins:
- serverless-offline