Web Development · Intermediate level

Intermediate level · Module 4 of 6 · 16 guided hours

Back-End Basics with Node.js and Express

Understand the client–server model and build a JSON API with Express, including routing, middleware and validation.

Learning objectives

  • Explain the client–server model and REST conventions
  • Build routes and middleware with Express
  • Validate input and return correct status codes

Topics

  • client–server and REST
  • Node.js and npm
  • Express routes and parameters
  • middleware and JSON parsing
  • validation and error handling
  • environment variables

Lessons

  1. Lesson 1 Clients, Servers and REST

    Understand how front ends talk to back ends and design endpoints that follow REST conventions.

    client and serverresource and endpointHTTP methodsstatus codes

  2. Lesson 2 Building an API with Express

    Create an Express server with routes, route parameters and middleware that returns JSON.

    Express approute handlerreq.params and req.querymiddleware

  3. Lesson 3 Validating Input and Handling Errors

    Validate every request on the server, respond with clear errors and keep secrets in environment variables.

    server-side validationerror response formatenvironment variablesnever trust the client

Practical activity

Build the API for the training centre: list and show courses, and accept enquiries with validation.

Expected outcomes

  • A working JSON API
  • Server-side validation habits

Assessment

Practical: implement two endpoints for a provided specification; tested with a REST client including invalid input.

Taught live by an instructor — online or in person. Free course lessons are for self-study and do not lead to a certificate — see registration options.