REST API with Express.js

This is a tutorial about making a REST API using Express and either MySQL or PostgreSQL. There is also a short exmple about using MongoDB.

Nodejs

Node.js is an open-source, cross-platform, back-end JavaScript runtime environment that runs on the V8 engine and executes JavaScript code outside a web browser.

Express

Express is a minimal and flexible Node.js web application framework that provides a robust set of features for web and mobile applications.

REST API

A RESTful API is an architectural style for an application program interface (API) that uses HTTP requests to access and use data. That data can be used to GET, PUT, POST and DELETE data types, which refers to the reading, updating, creating and deleting of operations concerning resources.

Frontend and Backend

A REST API is a backend application. In programming, the terms frontend and backend refer to different parts of a software application, each handling specific responsibilities.

Frontend:

  • The frontend is the user interface, or client-side, of the application that users interact with.
  • It includes everything users see and interact with, such as buttons, forms, and other UI elements.
  • Common frontend technologies include HTML, CSS, and JavaScript, along with frameworks like React, Angular, and Vue.js.

Backend:

  • The backend is the server-side of the application, responsible for data management, business logic, and communication with the database.
  • It handles tasks such as database operations, authentication, and API endpoints.
  • Common backend technologies include programming languages like Python, Java, and Ruby, as well as frameworks like Node.js, Django, and Spring Boot.
  • Databases such as MySQL, PostgreSQL, and MongoDB are often used to store and manage data.

In summary, the frontend is responsible for the user experience, while the backend manages behind-the-scenes processes that enable functionality and data interaction.

Full-Stack Development:

A full-stack developer works with both the frontend and backend, bridging the gap between the user interface and server-side operations. Full-stack development involves using a combination of frontend and backend technologies to build complete applications.

Client-Side vs. Server-Side

In web development, programming languages can be classified as client-side or server-side. This classification refers to where the code is executed: on the client (the user's device) or the server.

JavaScript was traditionally a client-side language executed in web browsers. However, with the introduction of Node.js, it can also be executed on the server.



Toggle Menu