A question on monorepos when using the sst/live la...
# sst
l
A question on monorepos when using the sst/live lambda approach: It seems one would do a
npx create-serverless-stack@latest <microservice name>
in the parent folder for each microservice in the monorepo? Or, one could also do the
npx create-serverless-stack
once, and then put the microservices in each of their own directories under
src
. And then, in
lib
create one stack per microservice, each with the API, Lambda, DynamoDB table(s) and whatever other serverless pieces and deploy a stack per microservice.
f
Hey @Luke Wyman, I’d recommend go with the latter. Here’s a starter with a similar concept https://github.com/serverless-stack/lerna-yarn-starter
It’s got an SST app sitting at the root of the repo, and has microservices in it.
l
okay, looking at it now. yeah, asking Qs before thinking haha. the second way seems really elegant.
f
It doesn’t strictly enforce 1 stack per microservice, but that does sound like a good setup.
l
Yeah, then all your naming/prefixing of resource names can be named like
[app name]-[microservice name]-get-notes.handler
, and name your tables like that and such.
f
Yup!