0

I am trying to remove the redundant path which is used in both my serverless configuration and aws api gateway mapping.

Problem: Login serverless yaml

serverless.yml

...
functions: 
  login: 
    name: login
    handler: login.handler
    events: 
      - http: 
          path: login
...

API mapping to my custom domain

  1. API – login-dev
  2. Stage – dev
  3. Path(optional) – login

Goal: Lambda Functions :

  1. login – {base url}/dev/login
  2. register – {base url}/dev/register

Actions taken:

  1. Tried to remove the Path(optional) but it would not allow me to add another lambda function if path is omitted.
  2. Tried to proxy(unsure if this works the way i understand it) but it doesn;t allow because an error shows that {login} is used in one of my lambda function parameters.
  3. Removed path in serverless yaml configuration file and replaced it with blank or / – but not an option for me because i need to keep the existing configuration.

Any help is very much appreciated.

Anonymous Asked question May 14, 2021