How to set up aws lambda to use same endpoint for different stages

I want to create a lambda and use single endpoint and only the path prefix changing for stages. I think this was possible a while ago without any setting … but now it doesn’t work. I always get different endpoints:

https://abc123.execute-api.us-east-1.amazonaws.com/dev/first-endpoint
https://xyz987.execute-api.us-east-1.amazonaws.com/prod/first-endpoint

But I would like to have:

https://abc123.execute-api.us-east-1.amazonaws.com/dev/first-endpoint
https://abc123.execute-api.us-east-1.amazonaws.com/prod/first-endpoint

Would love your suggestions.

My yml file looks like:

service: lambda-helloworld
provider:
  name: aws
  runtime: nodejs10.x
functions:
  hello:
    handler: handler.hello
    events:
      - http:
          path: first-endpoint
          method: GET

Hi balavec and welcome the Serverless community.

There is definitely a way to get the same URL endpoints. You just need to add some additional configuration. It is in fact documented on our site here: https://serverless.com/framework/docs/providers/aws/events/apigateway#share-api-gateway-and-api-resources

Hope that helps