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

Method is not honored

Open ewrogers opened this issue 6 years ago • 1 comments

It seems that the method value is not honored in the serverless.yml functions:

functions:
  get-users:
    handler: handler.getUsers
    events:
      - http:
          method: get
          path: "${self:custom.apiPrefix}/users"
  add-user:
    handler: handler.addUser
    events:
      - http:
          method: post
          path: "${self:custom.apiPrefix}/users"

Both GET and POST route to the same get-users handler function. Is the expectation really to make sure each route has an individual and unique name? It's a bit unconventional for REST API development to not support this.

ewrogers avatar Aug 15 '19 16:08 ewrogers

That's correct, the method key is not being used by kubeless. Every function accept all the methods right now.

andresmgot avatar Aug 19 '19 09:08 andresmgot