Well, I've been using express for routing and mongoose/sequelize to connect my server with my database for a while, and just wanted to try to build my own router and my own database-connector and use them to build a RESTful API using just native modules. :man-shrugging::skin-tone-5:
In this project, I implemented (and much more):
Instant updates on the sever when some file is edited (as nodemon does).
Routing using the Middleware pattern (as express does).
Schema definition to define the data structures used to define the API entities.
Validate the data before save or update using the pre-defined Schema.
Ok, now you're maybe thinking: "What? We already have some libs that someone else created that helps us to do it all (as express and mongoose and mongoose/sequelize that I mentioned)! Why re-invent the wheel"?
And I'll answer you: And I answer you: I know we don't always have time to implement our own ideas to solve certain problems that we face in our daily lives as engineers who use programming to create solutions, but I really want to encourage you, whenever possible, to try to build your own solutions and codify your ideas for these problems, this will make you a much more independent developer and of course much more confident in using a programming language. Apart from the fact that of course this experience will make you expand your knowledge
and make you feel amazing while implementing each feature (as I'm feeling now)!
PS: Treat this project as a personal challenge that I set myself, so there is no intention of running this API in production. Therefore,
This project is not a perfect solution and certainly not better than the ones that already exist in the market, but I want to share this knowledge I learned and implemented with the community so that everyone can benefit from what I did!
Without further ado, here's the repo!