Node.js: Build and Ship an API
From the V8 engine to production: modules, npm, files, asynchronous code, HTTP server, Express, REST APIs, PostgreSQL, authentication, testing, security and deployment of an online store API.
A MasterLinux course · Original text
What you will learn
- Understand how Node.js runs JavaScript on the server (V8, event loop, LTS releases)
- Organize a project with modules (CommonJS and ES modules), npm, package.json and semantic versioning
- Read and write files and JSON without blocking the server, with fs/promises and streams
- Write a native HTTP server, then an Express application with routes, middleware and error handling
- Design a clean REST API (resources, verbs, status codes, validation, pagination)
- Connect PostgreSQL with parameterized queries, a connection pool and migrations
- Authenticate users (hashed passwords, sessions, JWT, secure cookies) and test your code with node:test
- Secure, configure and deploy a Node API in production (pm2 or systemd, nginx, Docker)
Course content
14 lessons · 13 h 55 minSection 1 — Node.js fundamentals
Section 2 — Servers and APIs
- Un serveur HTTP natif avec node:http : routes, codes et en-têtes 1 h
- Express (1) : application, routes, paramètres, req et res 55 min
- Express (2) : middlewares, gestion d'erreurs, fichiers statiques et routeurs 1 h
- Concevoir une API REST : ressources, verbes, codes, validation et pagination 1 h
- Connecter PostgreSQL : pg, requêtes paramétrées, pool et migrations 1 h 5 min
Section 3 — Quality and production
Requirements
- The “Web Development: HTML, CSS and JavaScript” course or solid experience with modern JavaScript (functions, objects, promises)
- Comfortable with a Linux terminal (the “Fundamentals” course is recommended)
- Basic knowledge of HTTP (request, response, URL) and SQL
Who is this course for?
- Front-end developers who also want to write the server and the API
- Computer science students (BTS, DUT, bachelor’s degree, engineering schools) preparing for a back-end internship or first job
- PHP or Java developers moving to Node.js
- Freelancers who build APIs for online stores, riads or delivery apps