is there any quick way to get prettier Lambda func...
# help
s
is there any quick way to get prettier Lambda func names? other than defining
functionName
for every API route?
t
Can follow the discussion around this over here: https://github.com/serverless-stack/serverless-stack/discussions/236
I'm leaning towards supporting some kind of callback to generate the name that can be set as a defaultFunctionProp in the api
s
yeah, I was about to write a helper function to let me easily define routes & automatically name them in a clean way
t
That's what I've done in the meantime as well
j
@Frank @thdxr - any update on friendly lambda function names?
f
Hey @Jack Fraser not yet.. we haven’t gotten a consensus on this one, ppl seem to have different naming patterns. I’m leaning towards adding a callback to set a name based on the function props.
Btw, how do you plan to name the functions (ie. based on the filename)?
j
@Frank I think a simple lambdaNamePrefix etc on the default function props which, if set, would set the lambdae name to [lambdaNamePrefix]-[filename]-[randomNanoGuid] Then be up to the dev to do something sensible with the prefix that works for their project. The current default could be improved as can land up being very long.
@Frank any further thoughts on this?
f
Hey @Jack Fraser, I’m working on being able to provide a function name generator where u can pass in a callback. The cb will be called with the function property, and returns the function name.
I’m working on it now. Will keep you posted.
@Sam Hulick @Jack Fraser You can now pass in a callback for
functionName
in v0.54.4
s
whoa, nice! thanks @Frank 🙂