Backend JavaScript REST API

Build a REST API with Node.js and Express — No Database

Build a full CRUD REST API with Node.js and Express using in-memory data: routing, GET/POST/DELETE/PATCH, middleware, and HTTP status codes.

Course description

Your First REST API in Node.js — No Database, No Excuses

The best way to understand how a REST API works is to build one from scratch. In this course, we use Node.js and Express to create a complete CRUD API with in-memory data — no database, no complex configuration. Just the heart of the backend: routing, middleware, and HTTP response handling.

What We Build Together

  • Client-Server Architecture: what really happens when the browser makes a request
  • Installing Node.js and setting up the project with npm
  • Initializing an Express server with basic routing
  • GET endpoints: returning lists of objects and single records via request params
  • In-memory mock data: testing the logic without a database
  • POST endpoints with body-parser to receive JSON data
  • DELETE and PATCH: removing and updating objects tested with Postman
  • Standardizing HTTP responses with consistent status codes

Who This Course Is For

JavaScript developers who know the frontend and want to understand how the backend works. It is the ideal starting point before adding a real database and moving to a more structured architecture.

Why No Database

Working with in-memory data lets you focus on what truly matters: route structure, HTTP error handling, and response shape. Once you understand this, adding MongoDB or PostgreSQL becomes straightforward — the logic is already clear.

Lessons list

I'll walk you through the fundamentals of Client-Server architecture and explain how Node.js and Express fit into this model. We'll explore what actually happens behind the scenes when a browser makes a request to a server.

Guarda lezione

Let's set up your development environment from scratch. I'll show you how to install Node.js and initialize your first project using npm init, configuring the package.json with all the necessary settings.

Guarda lezione

I'll show you how to initialize an Express server with a minimal configuration. We'll define the first routes, start the server on a local port, and verify everything is working correctly.

Guarda lezione

Let's create in-memory mock data and build a GET endpoint that returns a list of objects in JSON format. This approach lets us test the API logic without needing a real database.

Guarda lezione

I'll show you how to use request parameters in Express to fetch and return a single object from the in-memory dataset. We'll also handle the case where the item is not found, returning the appropriate HTTP status code.

Guarda lezione

Let's implement a POST endpoint to add new objects to the in-memory collection. I'll guide you through installing and configuring body-parser (or Express's built-in JSON middleware) to correctly parse the incoming request body.

Guarda lezione

I'll show you how to use Postman to send POST requests to your Express API and verify that new objects are correctly inserted. We'll inspect the request body, headers, and the server response together.

Guarda lezione

Let's build a DELETE endpoint to remove objects from the in-memory array. I'll show you how to test it with Postman and handle edge cases like deleting a non-existent resource.

Guarda lezione

I'll show you how to implement a PATCH endpoint in Express to partially update existing objects. We'll test the route with Postman, sending only the fields we want to modify in the request body.

Guarda lezione

Let's wrap up the course by standardizing all API responses with a consistent structure and the correct HTTP status codes. I'll explain when to use 200, 201, 400, 404, and 500, and refactor all existing endpoints accordingly.

Guarda lezione
Giovanni Pace

Giovanni Pace

Ingegnere Informatico · Pratola Peligna

  • 107 Courses
About the teacher

Sono un ingegnere informatico con oltre 15 anni di esperienza nel settore ICT. Mi occupo di sviluppo software, cybersecurity, data science e intelligenza artificiale, con particolare attenzione all’innovazione e all’automazione dei processi aziendali. Da anni svolgo anche attività di docenza e formazione, creando percorsi pratici e coinvolgenti su programmazione, DevOps, AI e sicurezza informatica.

This course includes

  • Lessons 10
  • Duration 1h 41m
  • Difficulty base
  • Language it
  • Certificate No

Recently viewed