# 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: serverless-lambda-auth # app and org for use with dashboard.serverless.com #app: your-app-name #org: your-org-name # You can pin your service to only deploy with a specific Serverless version # Check out our docs for more details frameworkVersion: ^3.22.0 custom: babelPresets: - latest webpack: webpackConfig: webpack.config.babel.js plugins: - serverless-webpack - serverless-offline provider: name: aws runtime: nodejs12.x region: us-east-1 timeout: 30 functions: authEndpoint: handler: handler.auth hello: handler: handler.hello events: - http: path: hello method: GET cors: true authorizer: authEndpoint resources: Resources: GatewayResponse: Type: 'AWS::ApiGateway::GatewayResponse' Properties: ResponseParameters: gatewayresponse.header.Access-Control-Allow-Origin: "'*'" gatewayresponse.header.Access-Control-Allow-Headers: "'*'" ResponseType: EXPIRED_TOKEN RestApiId: Ref: 'ApiGatewayRestApi' StatusCode: '401' AuthFailureGatewayResponse: Type: 'AWS::ApiGateway::GatewayResponse' Properties: ResponseParameters: gatewayresponse.header.Access-Control-Allow-Origin: "'*'" gatewayresponse.header.Access-Control-Allow-Headers: "'*'" ResponseType: UNAUTHORIZED RestApiId: Ref: 'ApiGatewayRestApi' StatusCode: '401'