🌐Express.js
Also known as Express, ExpressJS
A small, plain web framework. It helps you build a server with Node.js.
Think of it like
Think of it like a plain, sturdy table. It does one job well, and you add the rest yourself.
Example
Lucy builds a tiny API for her shop with Express. Ten lines of code answer requests on port 3000.
Why it matters
Lots of coders start their server work with Express. It is small and easy to read.
Definition
Example code
javascript
const express = require("express");
const app = express();
app.get("/", (req, res) => res.send("Hi Emma"));
app.listen(3000);Common mistake
Key takeaways
- 1Small. Routes, requests, responses.
- 2Add middleware. Plug in what you need.
- 3Runs on Node.js. JavaScript on the server.