serverless-offline icon indicating copy to clipboard operation
serverless-offline copied to clipboard

Missing Resource-Path for Non-GET http methods

Open Beyondem opened this issue 6 years ago • 0 comments

Hello,

I am running serverless offline with my config like this below:

service: menu

plugins:
  - serverless-offline

custom:
  serverless-offline:
    useChildProcesses: true
    noPrependStageInUrl: true
    httpPort: 4000

  request:
    template: 
      application/json: '${file(./Lambda/mapping.txt)}'
      application/x-www-form-urlencoded: ''

  corsConfig:
    origin: '*'
    headers:
      - Authorization
      - content-type

provider:
  name: aws
  runtime: nodejs12.x
  stage: dev
  region: us-east-2
  endpointType: REGIONAL
  integration: lamba
  memorySize: 128
  timeout: 25

functions:
  app:
    handler: index.handler
    events:
      - http:
          path: /search/filters
          method: get
          cors: ${self:custom.corsConfig}
          integration: lambda
          request: ${self:custom.request}

      - http:
          path: locations
          method: get
          cors: ${self:custom.corsConfig}
          integration: lambda
          request: ${self:custom.request}

      - http:
          path: location/{location}/products
          method: get
          cors: ${self:custom.corsConfig}
          integration: lambda
          request: ${self:custom.request}

      - http:
          path: location/{location}/products
          method: delete
          cors: ${self:custom.corsConfig}
          integration: lambda
          request: ${self:custom.request}

It seems only the GET methods work. Any thing else, the event context is missing a resource-path and http-method.

Any insight into what may be going on?

Beyondem avatar Sep 23 '20 13:09 Beyondem