Skip to main content

Express

Express is a minimal Node.js framework for building web servers and APIs.

What Is Express

Express provides routing, middleware, request handling, and response helpers.

It is flexible and often used for REST APIs, server-rendered pages, and backend services.

How To Use Express

Create an app, define routes, add middleware, and start an HTTP server.

Basic Example

import express from 'express';

const app = express();

app.get('/health', (req, res) => {
res.json({ok: true});
});

app.listen(3000);

Common Concepts

  • Routes connect URLs to handlers.
  • Middleware runs before route handlers.
  • Request objects contain incoming data.
  • Response objects send output.

What To Learn Next

Learn middleware, validation, authentication, error handling, routers, and database integration.