# Welcome to Serverless!
#
# This file is the main config file for your service.
# It's very minimal at this point and uses default values.
# You can always add more config options for more control.
# We've included some commented out config examples here.
# Just uncomment any of them to get that config option.
#
# For full config options, check the docs:
#    docs.serverless.com
#
# Happy Coding!

service: basic

plugins:
  - serverless-offline

provider:
  name: aws
  runtime: nodejs4.3

# you can overwrite defaults here
#  stage: dev
#  region: us-east-1

# you can add statements to the Lambda function's IAM Role here
#  iamRoleStatements:
#    - Effect: "Allow"
#      Action:
#        - "s3:ListBucket"
#      Resource: { "Fn::Join" : ["", ["arn:aws:s3:::", { "Ref" : "ServerlessDeploymentBucket" } ] ]  }
#    - Effect: "Allow"
#      Action:
#        - "s3:PutObject"
#      Resource:
#        Fn::Join:
#          - ""
#          - - "arn:aws:s3:::"
#            - "Ref" : "ServerlessDeploymentBucket"

# you can add packaging information here
#package:
#  include:
#    - include-me.js
#  exclude:
#    - exclude-me.js
#  artifact: my-service-code.zip

functions:
  hello:
    handler: handler.hello
    events:
      - http:
          path: hello
          method: get
      - http:
          path: hello
          method: post

  hello500:
    handler: handler.hello500
    events:
      - http:
          path: hello500
          method: get
      - http:
          path: hello500
          method: post

  helloLambdaIntegration:
    handler: handler.helloLambdaIntegration
    events:
      - http:
          path: helloLambdaIntegration
          method: get
          integration: lambda
      - http:
          path: helloLambdaIntegration
          method: post
          integration: lambda

  helloLambdaIntegration500:
    handler: handler.helloLambdaIntegration500
    events:
      - http:
          path: helloLambdaIntegration500
          method: get
          integration: lambda
      - http:
          path: helloLambdaIntegration500
          method: post
          integration: lambda

#      - s3: ${env:BUCKET}
#      - schedule: rate(10 minutes)
#      - sns: greeter-topic

# you can add CloudFormation resource templates here
#resources:
#  Resources:
#    NewResource:
#      Type: AWS::S3::Bucket
#      Properties:
#        BucketName: my-new-bucket
#  Outputs:
#     NewOutput:
#       Description: "Description for the output"
#       Value: "Some output value"
