Empresas
Empregos
  • Sobre nós
  • Soluções
    • Publicação de vagas
      Publique sua vaga e receba candidatos qualificados em 48h.
    • Avaliações de candidatos
      Mais de 500 testes técnicos e psicológicos, mais anti-fraude.
    • Headhunting
      Busca executiva personalizada do início ao fim.
    • Folha de Pagamento + EOR
      Dispersão de folha e EOR em mais de 15 países da LATAM.
  • Preços
  • Empregos

0

382
Visualizações
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
Responde à pergunta
Encontrar trabalhos remotos

Descubra a nova forma de encontrar um emprego!

melhores empregos
Principais categorias de trabalho
Empresas
Postar vaga Preços Comercial
Jurídico
Termos e Condições Política de privacidade
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomende algumas ofertas para mim
Preciso de ajuda