Saturday, 13 October 2018

Another "which Node framework do I pick?" thread - with specifics - looking at Koa, Nest & Fastify, and maybe more

I'm trying to choose a Node backend framework, and have been looking into them over the last 6 months or so, but having trouble deciding what to use.Some info on what I'm after:My frontends will be in Vue+NuxtWhile my Nuxt frontends for each website will be separate projects, the backend API will be a single project that serves multiple websites.I use TypeScript for everything - so the more TypeScript support the betterI'm coming from PHP - and I'm used to just being able to have a global exception handler the in the entry index.php file - and I can throw an exception from anywhere, and that global exception handler will log it etc, and show a generic error screen to the user. I think this means I want to avoid older callback style frameworks like Express? But I also saw mentions of that being "solved" in future versions... did that happen? I can't find much info about it, so I'm assuming that the benefits of Koa are still a point of difference?I've heard that Express has the most middleware - but don't yet understand why middleware is specific to the framework, or if some stuff that was made for Express can be used with other frameworks?Solo dev on large personal projects - no need to worry about other devs coming on with prior knowledge or anythingNot sure if this is relevant or not - but after 19 years hating anything involving code generation... I'm starting to do a little bit of it now where suitable, I'm autogenerating things like ORM models, and moving towards a more declarative style of programming where all my projects/schemas/SQL tables/forms/pages etc are defined in some definitions in typescript, and I just write one form processor for example that handles all forms based on definitions. Also auto-generate TypeORM models and stuff like that. Fastify mentions it uses JSON Schema - so that sounds like it might be relevant, but not really sure what the advantages are yet.Will use async/await where possible.Servers will always be running Node 10+ , and fully control and run all my own servers... no need to worry about old versions etc.I'm mainly been looking at Koa, Fastify & Nest. Not sure which of these (or any others) might suit me most?

Submitted October 14, 2018 at 07:28AM by r0ck0

No comments:

Post a Comment