Node JS
Node.js is an open-source and cross-platform runtime environment for executing JavaScript code outside a browser, and it enables you to use the Javascript server side. This now means you could have consistent language on both ends which could not be done prior to Node. You need to remember that NodeJS is neither a framework nor a programming language. Most people are confused and understand it's a framework or a programming language. We often use Node.js for building back-end services like APIs.
Prerequisites
Before you start learning express, you must have some basic understanding of the following topics. In this section, we will cover the prerequisites for learning express.
Express JS
Express JS is a back-end web application framework for Node.js, released as free and open-source software under the MIT License. It is designed for building simple API to build websites, web apps, and back ends using JavaScript (and TypeScript). It has been called the de facto standard server framework for Node.js.
Backend vs Frontend vs API
The backend is the server side of a web application. It is responsible for storing and retrieving data from a database, processing user requests, and generating dynamic web pages. API is an interface that allows different applications to communicate with each other. It is a set of rules that allow programs to communicate with each other over the Internet. Frontend is the part of the site that users see and interact with, so it needs to be designed and developed in a way that is intuitive, user-friendly, and aesthetically pleasing.
Basic Code
We have learned about the basic concepts of Express. Now, we will learn how to create a basic Express application. We will learn how to create a development environment, how to create a new project, how to install Express, and how to create a server.
app.HTTP_METHOD
app.HTTP_METHOD() allows you to handle HTTP requests with a specific method, such as GET, POST, PUT, DELETE, etc.
CRUD - Create, Read, Update and Delete APIs
CRUD is an acronym for Create, Read, Update and Delete. It is a set of operations that servers to execute POST, GET, PUT, PATCH, DELETE, etc. In this blog, we will learn how to do CRUD in Express.
Modular Routing
Modular Routing is a way to organize your routes in a more structured way. It is a way to split your routes into multiple files and then import them into your main file. This makes your code more readable and maintainable. It also makes it easier to add new routes to your application.
Node server without using Express
In this blog, we will learn how to build a Node server without using Express.