is there a less repetitive way to get “pretty” Lam...
# help
s
is there a less repetitive way to get “pretty” Lambda function names yet? instead of doing this for every single function:
Copy code
'POST /reels/{reelId}/links': {
        function: {
          handler: `${restFuncBasePath}/create-share-link.main`,
          functionName: `${this.stackName}-createShareLink`,
        },
      },
      'POST /reels/{reelId}/versions': {
        function: {
          handler: `${restFuncBasePath}/duplicate-reel-version.main`,
          functionName: `${this.stackName}-duplicateReelVersion`,
        },
      },
The default naming convention is really difficult to read (e.g.
dev-microservices-api-ree-LambdaPATCHreelsreelId18-oXcbK4Ndqlga
)
a
You could do it at the end of the definition in a loop for all routes using the handler string of each to form it
something like this maybe
Copy code
api.routes.map(route => {
      route.function.functionName = "";// process route.function.handler string in some way here
      return route;
   });
or will that be too late already maybe?
if so, you could probably feed a function into the definition that does it based on the handler passed as parameter
it could then look like this:
Copy code
'POST /reels/{reelId}/links': createRouteConfig("create-share-link.main"),
'POST /reels/{reelId}/versions': createRouteConfig("duplicate-reel-version.main"),