<https://github.com/serverless-stack/serverless-st...
# sst
t
I was actually thinking of inheriting from @tsconfig/node14 - it's what I do for all my projects
ö
Me too, though I add some additional stuff. However, instead of inherting embeding it would be better for more control
Plus the default runtime for node defaults to node 12 when u create with create serverless stack. Thus I guess it is better to inherit from tsconfig/node12
t
Yeah I thinkw e should update that too
there's a series of things I always do after I make a new project that should just be in the core template
ö
I agree, I change the node version every time 😄
Yeah me too 😄
Can we pass the StackName?
%stack-name.PascalCased%.template.ts
s
I always change from default export to named export, but maybe that's bike shedding
@Ömer Toraman I worked on a command for this, since I am always doing multi stacks. https://github.com/simonireilly/serverless-stack/pull/4
Copy code
sst add-stack MyStackName
ö
Yes! I agree that using named export matters for both TypeScript and VS Code. I try not to use default exports as much as possible.
I like the idea! I previously used nestjs, and honestly like how it creates some resources with CLI
s
Yeah, all the templates are there already tbh. Just case of plugging it together. Also, there is documentation to show how to use multistacks, but better to have CLI. This follows show, don't tell, principals
ö
This is not the part of this discussion, but what I’m looking for is to really take the pain away inside Lambda functions. deserializing, validation, serializing, logging, error handling It quickly becomes one big function that is hard to read and a mess.
s
Wonder about this a lot too. Especially with frameworks like fastify, and tsoa in server bound deployments. Still, the contract between the application type, and the openAPI schema is something I think works for these deserializing, validation, serialising and error handling definition. Logging itself is a separate concern IMO. I just bang in pino logger for JSON logs.
ö
Do u use openAPI schema?
But yeah it is great
But how would you know that the request was rejected because of validation for example, since it will never hit the Lambda
Pino says it is 5 times faster, but the benchmark they show doesnt seem so lol
s
Couple of questions there, one, pinonis probably fast enough for me, especially since we aren't too worried about concurrency in lambda. Second, yeah, I wouldn't integrate open API with aws apigateway rest API v1. To me that's too much buying into AWS, would rather keep the app portable. Something like ajv JSONSchemaType<T> with validator and serializer is what I'd be looking at
ö
I see. I use class validator instead.
Any microservice framework do u use, if it can be thought as a framework
like middy
or this