🟩

Node.js & Express

JavaScript on the server

Run JavaScript on the server. Build fast APIs and backends with Node.js and the Express framework β€” the foundation of most JS backends.

πŸ“˜ 15 lessonsπŸš€ 3 projectsπŸ—ΊοΈ 2 roadmaps🐞 5 error fixes

Node.js & Express Setup

Install Node.js and stand up your first Express server.

1

Install Node.js

terminal
# Download the LTS build from https://nodejs.org

What it does

Node.js runs JavaScript outside the browser and ships with npm to install packages.

Why you need it

Express and every npm package run on Node β€” nothing works without it.

Alternatives: Use nvm/fnm to manage multiple Node versions per project.

2

Create a project

terminal
mkdir my-api && cd my-api
npm init -y

What it does

`npm init -y` creates a package.json that tracks your dependencies and scripts.

Why you need it

It's the manifest npm uses to install and run everything in your project.

3

Install Express

terminal
npm install express

What it does

Express is a minimal web framework for routing and handling HTTP requests.

Why you need it

It saves you from writing raw `http` server boilerplate for every route.

Alternatives: Fastify, Hono, Koa, or the built-in `node:http` module.

4

Run your server

terminal
node index.js

What it does

Start your server file. Add a `dev` script with nodemon for auto-restart on changes.

Why you need it

You need the server running to handle requests while you build.