Skip to content

Commit a07824f

Browse files
committed
Add initial Serverless structure
1 parent 43e89fa commit a07824f

File tree

4 files changed

+84
-0
lines changed

4 files changed

+84
-0
lines changed

event.json

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
{
2+
"key3": "value3",
3+
"key2": "value2",
4+
"key1": "value1"
5+
}

handler.js

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
'use strict';
2+
3+
// Your first function handler
4+
module.exports.hello = (event, context, cb) => cb(null,
5+
{ message: 'Go Serverless v1.0! Your function executed successfully!', event }
6+
);
7+
8+
// You can add more handlers here, and reference them in serverless.yml

serverless.env.yml

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
# This is the Serverless Environment File
2+
#
3+
# It contains listing of your stages and their regions
4+
# It also manages serverless variables at 3 levels:
5+
# - common variables: variables that apply to all stages/regions
6+
# - stage variables: variables that apply to a specific stage
7+
# - region variables: variables that apply to a specific region
8+
9+
vars:
10+
stages:
11+
dev:
12+
vars:
13+
regions:
14+
eu-west-1:
15+
vars:

serverless.yml

Lines changed: 56 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,56 @@
1+
# Welcome to Serverless!
2+
#
3+
# This file is the main config file for your service.
4+
# It's very minimal at this point and uses default values.
5+
# You can always add more config options for more control.
6+
# We've included some commented out config examples here.
7+
# Just uncomment any of them to get that config option.
8+
#
9+
# For full config options, check the docs:
10+
# v1.docs.serverless.com
11+
#
12+
# Happy Coding!
13+
14+
service: slack-library # NOTE: update this with your service name
15+
16+
provider:
17+
name: aws
18+
runtime: nodejs4.3
19+
20+
# you can overwrite defaults here
21+
defaults:
22+
stage: dev
23+
region: eu-west-1
24+
25+
# you can add packaging information here
26+
#package:
27+
# include:
28+
# - include-me.js
29+
# exclude:
30+
# - exclude-me.js
31+
# artifact: my-service-code.zip
32+
33+
functions:
34+
hello:
35+
handler: handler.hello
36+
37+
# you can add any of the following events
38+
# events:
39+
# - http:
40+
# path: users/create
41+
# method: get
42+
# - s3: ${bucket}
43+
# - schedule: rate(10 minutes)
44+
# - sns: greeter-topic
45+
46+
# you can add CloudFormation resource templates here
47+
#resources:
48+
# Resources:
49+
# NewResource:
50+
# Type: AWS::S3::Bucket
51+
# Properties:
52+
# BucketName: my-new-bucket
53+
# Outputs:
54+
# NewOutput:
55+
# Description: "Description for the output"
56+
# Value: "Some output value"

0 commit comments

Comments
 (0)