Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

375
Views
AWS HTTP Gateway: Multiple Methods for same Route excluding OPTIONS with Serverless Framework

I'm pretty excited about HTTP Gateways due to the drastically reduced pricing in comparison to REST Gateways, but I'm stuck on creating routes that do not completely blow up my serverless.yml file.

The documentation for HTTP Gateway at Serverless describes this to define routes:

functions:
  params:
    handler: handler.params
    events:
      - httpApi:
          method: GET
          path: /get/for/any/{param}

There is a support for '*', but this causes issues with OPTIONS cause those will overwrite the created CORS policies (so OPTIONS requests would actually get to the application, which does not make any sense, especially if the route is protected via an authorizer).

Also, it's not possible to define multiple methods.

# does not work
method: GET,POST,DELETE

# also not possible
method:
 - GET
 - POST
 - DELETE

The only configuration I found is to define all routes separately:

events:
  - httpApi:
      path: /someApi/{proxy+}
      method: GET
  - httpApi:
      path: /someApi/{proxy+}
      method: POST
  - httpApi:
      path: /someApi/{proxy+}
      method: DELETE

This works fine & the UI is even bundling the routes cause they're on the same prefixed path:

enter image description here

But with this I have to define all HTTP methods for all my main resources separately including the attached authorizer.

Is there some way to combine this?

over 4 years ago · Santiago Trujillo
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!