Articles
29 articles covering Node.js, JavaScript, backend development, and more.
Database in NodeJS
Now that we know the basics of SQL we can actually use it in our existing project. ### Preparation ### Parts of an SQL database When working with SQL, it Read more
API routes naming conventions
Now its time to talk about REST API routes naming convention. People usually get lost on how to name their routes especially when multiple models are in play for the Read more
Introducing views and transformers
Now we can work with our data but how do we send that data back to our clients? Using `res.end`? Pretty much, but we are going to wrap it inside, Read more
Introducing Models
We have our business logic stored in `Controllers` and we create some data we want to store in the database or we get some data from the database. We need Read more
Introducing Controllers
Currently we are handling our main/business logic inside our `routes.js` file. We want to change this by extracting our main/business logic to separate files. These files are called `Controllers`. ### Read more
Creating NodeJS project
In this post we are going to cover how to create a proper project with `npm init` and how to use npm packages. ### Creating a project Until now we Read more
Creating proper routes
We have a proper server but we are still not handling our routes properly. They are still a mess so let's do the same thing and rewrite existing `router` function Read more
Creating a proper server
So now we have a working server that handles routes but it is not able to grow with more routes and logic and we are not using classes. So let Read more
Routes
We've created a server but how can we start returning different responses for different requests? For that we will use `routes`. ### Url and Parts of Url Routes refer to Read more
Creating server
We are finally ready to start using NodeJS and create our webserver but before we do let's first go through some common terms and their definitions (also available in [Glossary](/blog/glossary)) Read more