Posts tagged 'class-based-views'
Tag: class-based-views
Bringing Class-Based Views to Fastify (Inspired by Django) Signature Post
Why doesn’t Node.js have something like Django’s Class-Based Views (CBVs)?
I love Django key features like its class-based views or ORM, and I usually miss them when working with Node.js. So yesterday night, in the middle of my usual insomnia, I wondered if anyone had already built something like that for Node.js.
I did a quick search, and what I found were just a few experiments from ~8–9 years ago. Nothing robust, modern, or maintained.
Django Class-Based Views (CBVs) provide a clear structure, lots of built-in functionality, and still enough flexibility to adapt them to different use cases. So I decided to sketch out a design for Fastify (and Node.js in general) that feels natural to use, contract-first, and TypeScript-friendly. This post is a walk-through of that exploration during the rest of the Sunday.