JavaScript on the Server
"Node.js IS the server. Unlike PHP which runs inside Apache, a Node.js application creates its own HTTP server and runs continuously."
CSE 135 — Full Overview | Review Questions
PHP processes requests and exits. Node.js runs continuously.
PHP runs inside Apache — a new process per request. Node.js IS the server — one process handling all requests continuously.
Five hands-on modules from Hello World to REST APIs.
| Module | Focus | Key Topics |
|---|---|---|
| 01. Hello World | Node.js fundamentals | Running scripts, ES6+ features, the event loop, callbacks & async |
| 02. HTTP Server | Building from scratch | http.createServer(), request/response objects, manual routing |
| 03. Express Basics | The Express framework | npm & packages, Express routing, static files, middleware |
| 04. Form Handling | Processing user input | req.query, req.body, body parsing middleware, PHP comparison |
| 05. REST API | RESTful CRUD | REST principles, HTTP verbs & resources, JSON responses |
Same web problems, fundamentally different approaches.
| Aspect | PHP | Node.js |
|---|---|---|
| Execution | Per-request (process starts/stops) | Persistent (runs continuously) |
| Server | Runs inside Apache/nginx | IS the server (creates own HTTP listener) |
| Concurrency | Multiple processes/threads | Single-threaded event loop |
| GET parameters | $_GET['name'] | req.query.name |
| POST body | $_POST['email'] | req.body.email |
| Sessions | Built-in ($_SESSION) | Requires middleware (express-session) |
| Package manager | Composer | npm |
| Best for | Traditional websites, CMSs | APIs, real-time apps, microservices |
node. The process stays running until you press Ctrl+C. Each demo listens on its own port (usually 3000).
Core modules, bare HTTP server, and Express basics.
These are built-in — no npm install needed. They ship with Node.js and provide the foundation for everything else.
file_get_contents5 concepts of Node.js server-side development in one table.
| Concept | Key Takeaway |
|---|---|
| Execution Model | Node.js IS the server — one persistent process handles all requests. PHP spawns a process per request inside Apache. |
| Tutorial Modules | 5 progressive modules: bare Node (01–02) teaches fundamentals, Express (03–05) adds the framework layer. |
| PHP Comparison | Same web problems, different architectures. PHP: per-request, built-in features. Node: persistent, middleware ecosystem. |
| Running Demos | Run with node file.js directly — no Apache needed. The process stays running until you stop it. |
| Quick Reference | Core modules (http, fs, path, url) are built-in. Express adds routing, middleware, and JSON/form parsing. |