Is it the expected behaviour that when defining mu...
# sst
s
Is it the expected behaviour that when defining multiple
sst.Api
routes pointing to the same handler a separate function instance/deployment is created for each route? Is there a way to avoid this duplication? I tried creating a function instance via
sst.Function
to share but then I get issues with the default function props.
t
@Frank how strong do you feel about erorring when people pass in a function and also default props
f
yeah, I don’t really like that.
It’s kind of similar to how we enforce calling
setDefaultFunctionProps
before any resources.
It’s really a side effect of how CDK create resources (ie. u can’t change certain props of a construct after it’s been created)
It’d be ideal if we allowed ppl to do that.
I can’t think of a good solution right away 🤔
s
Ok, no worries. I'll write a little function abstraction for defining the routes for now.
Really appreciate how responsive ya'll are.