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

REST API is a backend application. In programming, the terms "backend" and "frontend" refer to the different parts of a software application that handle specific responsibilities.

Frontend:

  • The frontend is the user interface or the client-side of the application that users interact with
  • It includes everything that users see and interact with, such as buttons, forms, and other elements on a website or application
  • Technologies commonly used for frontend development include HTML, CSS, and JavaScript

Backend:

  • The backend is the server-side of the application that manages data, business logic, and communication between the database and the frontend
  • It handles tasks that users don't directly interact with, such as database operations, authentication, and server-side logic
  • Backend technologies include server-side programming languages (e.g., Python, Java, Ruby), frameworks, and databases (e.g., MySQL, MongoDB)
In summary, the frontend is responsible for what users experience directly, while the backend manages the behind-the-scenes processes that enable the frontend to function and interact with data. Together, they make up the full stack of a software application.

Client-Side vs. Server-Side

In web development the programming languages can be classified to client-side languages or server-side languages. The terminology describes where te code is executed: in the client or in the server.

JavaScript used to be totally client-side language executed in browsers. But with Node.js it can be executed in the server.



Toggle Menu