node server.js

📦 Node.js
✨ The Prompt Phrase
To run node.js server using dictionary.html Under dictionary application is as follows. ~node server.js~

💻 Code Preview

📦 All-in-One Code
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Run node.js server - Interactive Tutorial</title>
<meta name="description" content="Learn how to run a Node.js server using node server.js for a dictionary application. Interactive beginner-friendly tutorial.">
<link rel="preconnect" href="https://fonts.googleapis.com">
<link href="https://fonts.googleapis.com/css2?family=Inter:wght@400;600;700;900&family=Fira+Code:wght@400;600&display=swap" rel="stylesheet">
<style>
:root {
  --bg: #0a0e1a;
  --surface: #12182b;
  --card: rgba(255,255,255,0.04);
  --glass: rgba(255,255,255,0.06);
  --border: rgba(255,255,255,0.08);
  --text: #e2e8f0;
  --muted: #94a3b8;
  --accent1: #a78bfa;
  --accent2: #818cf8;
  --accent3: #34d399;
  --accent4: #38bdf8;
  --grad1: linear-gradient(135deg, #a78bfa, #818cf8, #38bdf8);
  --grad2: linear-gradient(135deg, #34d399, #38bdf8);
  --danger: #f87171;
  --warn: #fbbf24;
  --radius: 16px;
  --font: 'Inter', system-ui, sans-serif;
  --mono: 'Fira Code', monospace;
}
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; }
body {
  font-family: var(--font);
  background: var(--bg);
  color: var(--text);
  line-height: 1.7;
  overflow-x: hidden;
}
.container { max-width: 860px; margin: 0 auto; padding: 0 20px; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0,0,0,0); }
.badge {
  display: inline-block; padding: 4px 14px; border-radius: 99px;
  font-size: .75rem; font-weight: 700; letter-spacing: .5px; text-transform: uppercase;
}
.badge-purple { background: rgba(167,139,250,.15); color: var(--accent1); }
.badge-green { background: rgba(52,211,153,.15); color: var(--accent3); }
.badge-blue { background: rgba(56,189,248,.15); color: var(--accent4); }
.section { padding: 60px 0; animation: fadeUp .8s ease both; }
.section:nth-child(odd) { animation-delay: .1s; }
.section:nth-child(even) { animation-delay: .2s; }
.section-title {
  font-size: clamp(1.5rem, 4vw, 2rem); font-weight: 900;
  margin-bottom: 1.2rem; display: flex; align-items: center; gap: 12px;
}
.section-title .emoji { font-size: 1.4em; }
.card {
  background: var(--card); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 28px; margin-top: 20px;
  transition: transform .3s, box-shadow .3s;
}
.card:hover { transform: translateY(-2px); box-shadow: 0 8px 30px rgba(0,0,0,.3); }
@keyframes fadeUp { from { opacity: 0; transform: translateY(30px); } to { opacity: 1; transform: translateY(0); } }
@keyframes glow { 0%, 100% { text-shadow: 0 0 20px rgba(167,139,250,.4); } 50% { text-shadow: 0 0 40px rgba(129,140,248,.6); } }
@keyframes float { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(-10px); } }
@keyframes pulse { 0%, 100% { opacity: .6; } 50% { opacity: 1; } }
@keyframes gradMove { 0% { background-position: 0% 50%; } 50% { background-position: 100% 50%; } 100% { background-position: 0% 50%; } }
@keyframes checkmark { 0% { transform: scale(0); } 60% { transform: scale(1.3); } 100% { transform: scale(1); } }
.progress-bar {
  position: fixed; top: 0; left: 0; right: 0; height: 4px; z-index: 100;
  background: var(--grad1); background-size: 200% 200%; animation: gradMove 3s ease infinite;
}
nav {
  position: fixed; top: 4px; left: 0; right: 0; z-index: 99;
  background: rgba(10,14,26,.85);
  border-bottom: 1px solid var(--border); padding: 12px 0;
}
nav .container { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 8px; }
nav .logo { font-weight: 900; font-size: 1.1rem; background: var(--grad1); -webkit-background-clip: text; -webkit-text-fill-color: transparent; }
nav a {
  color: var(--muted); text-decoration: none; font-size: .82rem; font-weight: 600;
  padding: 4px 10px; border-radius: 8px; transition: all .3s;
}
nav a:hover { color: var(--accent1); background: rgba(167,139,250,.1); }
.hero {
  min-height: 100vh; display: flex; align-items: center; justify-content: center;
  text-align: center; padding: 120px 20px 80px; position: relative;
}
.hero::before {
  content: ''; position: absolute; width: 500px; height: 500px; border-radius: 50%;
  background: radial-gradient(circle, rgba(129,140,248,.12), transparent 70%);
  top: 10%; left: 50%; transform: translateX(-50%); pointer-events: none;
}
.hero-badge { margin-bottom: 20px; }
.hero h1 {
  font-size: clamp(2.2rem, 6vw, 3.8rem); font-weight: 900; line-height: 1.15;
  margin-bottom: 20px; animation: glow 3s ease-in-out infinite;
}
.hero h1 .gradient-text { background: var(--grad1); -webkit-background-clip: text; -webkit-text-fill-color: transparent; }
.hero p { font-size: 1.15rem; color: var(--muted); max-width: 600px; margin: 0 auto 30px; }
.hero-cmd {
  display: inline-block; font-family: var(--mono); font-size: clamp(1rem, 3vw, 1.4rem);
  background: var(--surface); border: 1px solid var(--border); border-radius: 12px;
  padding: 16px 32px; color: var(--accent3); animation: float 3s ease-in-out infinite;
}
.hero-cmd .prompt { color: var(--accent1); }
.code-block {
  background: #0d1117; border: 1px solid rgba(255,255,255,.06);
  border-radius: 12px; overflow: hidden; margin: 16px 0;
}
.code-header {
  display: flex; align-items: center; gap: 8px; padding: 10px 16px;
  background: rgba(255,255,255,.03); border-bottom: 1px solid rgba(255,255,255,.06);
  font-size: .78rem; color: var(--muted);
}
.dot { width: 10px; height: 10px; border-radius: 50%; }
.dot-r { background: #f87171; } .dot-y { background: #fbbf24; } .dot-g { background: #34d399; }
.code-block pre {
  padding: 20px; overflow-x: auto; font-family: var(--mono);
  font-size: .9rem; line-height: 1.8; color: #e6edf3;
}
.step {
  display: flex; gap: 20px; margin: 24px 0; padding: 24px;
  background: var(--card); border: 1px solid var(--border);
  border-radius: var(--radius); transition: all .3s;
}
.step:hover { border-color: var(--accent2); }
.step-num {
  flex-shrink: 0; width: 44px; height: 44px; border-radius: 50%;
  background: var(--grad1); display: flex; align-items: center; justify-content: center;
  font-weight: 900; font-size: 1.1rem; color: #fff;
}
.step-content h3 { font-size: 1.1rem; font-weight: 700; margin-bottom: 6px; }
.step-content p { color: var(--muted); font-size: .95rem; }
details {
  background: var(--card); border: 1px solid var(--border);
  border-radius: var(--radius); margin: 12px 0; overflow: hidden;
  transition: all .3s;
}
details:hover { border-color: rgba(167,139,250,.3); }
details[open] { border-color: var(--accent2); }
summary {
  padding: 18px 24px; cursor: pointer; font-weight: 700; font-size: 1rem;
  list-style: none; display: flex; align-items: center; gap: 10px;
  transition: background .3s;
}
summary:hover { background: rgba(255,255,255,.03); }
summary::before { content: '\25B8'; transition: transform .3s; font-size: .85rem; color: var(--accent1); }
details[open] summary::before { transform: rotate(90deg); }
summary::-webkit-details-marker { display: none; }
.details-body { padding: 0 24px 20px; color: var(--muted); }
.tabs { margin: 24px 0; }
.tabs input[type="radio"] { display: none; }
.tab-labels {
  display: flex; gap: 4px; background: var(--surface);
  border-radius: 12px; padding: 4px; overflow-x: auto;
}
.tab-labels label {
  flex: 1; text-align: center; padding: 10px 16px; border-radius: 10px;
  cursor: pointer; font-weight: 600; font-size: .88rem;
  color: var(--muted); transition: all .3s; white-space: nowrap;
}
.tab-labels label:hover { color: var(--text); }
.tab-panel { display: none; padding: 24px 0; animation: fadeUp .4s ease; }
#tab1:checked ~ .tab-labels label[for="tab1"],
#tab2:checked ~ .tab-labels label[for="tab2"],
#tab3:checked ~ .tab-labels label[for="tab3"] {
  background: var(--grad1); color: #fff;
}
#tab1:checked ~ .tab-panels .panel-1,
#tab2:checked ~ .tab-panels .panel-2,
#tab3:checked ~ .tab-panels .panel-3 { display: block; }
.tip {
  position: relative; border-bottom: 1px dashed var(--accent1); cursor: help;
  color: var(--accent1); font-weight: 600;
}
.tip-text {
  display: none; position: absolute; bottom: 130%; left: 50%;
  transform: translateX(-50%); background: var(--surface); color: var(--text);
  border: 1px solid var(--border); border-radius: 10px; padding: 10px 14px;
  font-size: .82rem; font-weight: 400; white-space: nowrap; z-index: 10;
  box-shadow: 0 8px 20px rgba(0,0,0,.4); animation: fadeUp .2s ease;
}
.tip:hover .tip-text { display: block; }
.quiz-q { margin: 24px 0; }
.quiz-q h3 { font-size: 1.05rem; margin-bottom: 14px; }
.quiz-q input[type="radio"] { display: none; }
.quiz-q label {
  display: block; padding: 14px 20px; margin: 6px 0;
  background: var(--card); border: 1px solid var(--border);
  border-radius: 12px; cursor: pointer; font-size: .95rem;
  transition: all .3s;
}
.quiz-q label:hover { border-color: var(--accent2); background: rgba(129,140,248,.06); }
.quiz-feedback { display: none; margin-top: 10px; padding: 14px 20px; border-radius: 12px; font-weight: 600; }
.quiz-correct {
  background: rgba(52,211,153,.1); border: 1px solid rgba(52,211,153,.3); color: var(--accent3);
}
.quiz-wrong {
  background: rgba(248,113,113,.1); border: 1px solid rgba(248,113,113,.3); color: var(--danger);
}
#q1a:checked ~ label[for="q1a"],
#q1b:checked ~ label[for="q1b"],
#q1c:checked ~ label[for="q1c"] { border-color: var(--accent2); }
#q1b:checked ~ .fb-q1-correct { display: block; animation: checkmark .4s ease; }
#q1a:checked ~ .fb-q1-wrong, #q1c:checked ~ .fb-q1-wrong { display: block; }
#q2a:checked ~ label[for="q2a"],
#q2b:checked ~ label[for="q2b"],
#q2c:checked ~ label[for="q2c"] { border-color: var(--accent2); }
#q2a:checked ~ .fb-q2-correct { display: block; animation: checkmark .4s ease; }
#q2b:checked ~ .fb-q2-wrong, #q2c:checked ~ .fb-q2-wrong { display: block; }
#q3a:checked ~ label[for="q3a"],
#q3b:checked ~ label[for="q3b"],
#q3c:checked ~ label[for="q3c"] { border-color: var(--accent2); }
#q3c:checked ~ .fb-q3-correct { display: block; animation: checkmark .4s ease; }
#q3a:checked ~ .fb-q3-wrong, #q3b:checked ~ .fb-q3-wrong { display: block; }
.mistake {
  display: flex; gap: 16px; padding: 20px; margin: 12px 0;
  background: rgba(248,113,113,.05); border: 1px solid rgba(248,113,113,.15);
  border-radius: var(--radius);
}
.mistake-icon { font-size: 1.6rem; flex-shrink: 0; }
.mistake h4 { color: var(--danger); font-size: .95rem; margin-bottom: 4px; }
.mistake p { color: var(--muted); font-size: .9rem; }
.pro-tip {
  display: flex; gap: 16px; padding: 20px; margin: 12px 0;
  background: rgba(52,211,153,.05); border: 1px solid rgba(52,211,153,.15);
  border-radius: var(--radius);
}
.pro-tip-icon { font-size: 1.6rem; flex-shrink: 0; }
.pro-tip h4 { color: var(--accent3); font-size: .95rem; margin-bottom: 4px; }
.pro-tip p { color: var(--muted); font-size: .9rem; }
.summary-card {
  background: linear-gradient(135deg, rgba(167,139,250,.1), rgba(56,189,248,.1));
  border: 1px solid rgba(167,139,250,.2); border-radius: 20px; padding: 36px;
}
.summary-card h3 { font-size: 1.3rem; margin-bottom: 16px; }
.summary-card ul { list-style: none; }
.summary-card li { padding: 8px 0; display: flex; align-items: center; gap: 10px; font-size: .95rem; }
footer {
  text-align: center; padding: 40px 20px; border-top: 1px solid var(--border);
  color: var(--muted); font-size: .85rem;
}
footer .brand { font-weight: 700; background: var(--grad1); -webkit-background-clip: text; -webkit-text-fill-color: transparent; }
@media (max-width: 640px) {
  .step { flex-direction: column; gap: 12px; }
  .tab-labels { flex-direction: column; }
  .hero { padding-top: 100px; }
  nav a { font-size: .72rem; padding: 3px 6px; }
}
</style>
</head>
<body>

<div class="progress-bar" role="presentation"></div>

<nav aria-label="Tutorial navigation">
  <div class="container">
    <span class="logo">Node.js Tutorial</span>
    <div>
      <a href="#what">What</a>
      <a href="#why">Why</a>
      <a href="#how">How</a>
      <a href="#code">Code</a>
      <a href="#quiz">Quiz</a>
    </div>
  </div>
</nav>

<section class="hero" id="top">
  <div class="container">
    <div class="hero-badge"><span class="badge badge-purple">Interactive Tutorial</span></div>
    <h1>Running Your <span class="gradient-text">Node.js Server</span></h1>
    <p>Learn how to launch a Node.js server for your Dictionary application using a single, powerful command.</p>
    <div class="hero-cmd" aria-label="Command: node server.js"><span class="prompt">~$ </span>node server.js</div>
  </div>
</section>

<section class="section" id="what">
  <div class="container">
    <h2 class="section-title"><span class="emoji">&#x1F914;</span> What Is It?</h2>
    <div class="card">
      <p>The phrase <strong>"To run node.js server using dictionary.html under dictionary application... <code>node server.js</code>"</strong> means:</p>
      <br>
      <p>You have a <span class="tip">Node.js<span class="tip-text">Node.js is a runtime that lets you run JavaScript outside the browser</span></span> project &#8212; a <strong>Dictionary Application</strong> &#8212; that includes an HTML file (<code>dictionary.html</code>) for the front-end UI and a server file (<code>server.js</code>) for the back-end logic.</p>
      <br>
      <p>The command <code>node server.js</code> tells your computer: <em>"Hey, start the server so I can use my dictionary app in the browser!"</em></p>
    </div>

    <details>
      <summary>What does the project folder look like?</summary>
      <div class="details-body">
        <div class="code-block">
          <div class="code-header"><span class="dot dot-r"></span><span class="dot dot-y"></span><span class="dot dot-g"></span> Project Structure</div>
          <pre>dictionary-app/
+-- server.js          (Your Node.js server file)
+-- dictionary.html    (Your front-end page)
+-- package.json       (Project metadata)
+-- node_modules/      (Installed packages)</pre>
        </div>
      </div>
    </details>
  </div>
</section>

<section class="section" id="why">
  <div class="container">
    <h2 class="section-title"><span class="emoji">&#x1F4A1;</span> Why Use It?</h2>

    <div class="tabs">
      <input type="radio" name="tabs" id="tab1" checked>
      <input type="radio" name="tabs" id="tab2">
      <input type="radio" name="tabs" id="tab3">
      <div class="tab-labels">
        <label for="tab1">Serve HTML</label>
        <label for="tab2">Dynamic Data</label>
        <label for="tab3">API Access</label>
      </div>
      <div class="tab-panels">
        <div class="tab-panel panel-1">
          <div class="card">
            <h3>Serve Your HTML File</h3>
            <p>Simply double-clicking <code>dictionary.html</code> opens it as a local file. But with <code>node server.js</code>, you serve it on a real HTTP server &#8212; just like a real website! This lets you use <code>http://localhost:3000</code> in your browser.</p>
          </div>
        </div>
        <div class="tab-panel panel-2">
          <div class="card">
            <h3>Handle Dynamic Data</h3>
            <p>A static HTML file cannot search a database. But <code>server.js</code> can process search queries, look up words in a dictionary API or database, and send results back to the user in real-time!</p>
          </div>
        </div>
        <div class="tab-panel panel-3">
          <div class="card">
            <h3>Connect to APIs</h3>
            <p>Your server can fetch definitions from external dictionary APIs (like Merriam-Webster or Oxford) and relay them to your HTML front-end. This is the power of a back-end server!</p>
          </div>
        </div>
      </div>
    </div>
  </div>
</section>

<section class="section" id="how">
  <div class="container">
    <h2 class="section-title"><span class="emoji">&#x2699;&#xFE0F;</span> How Does It Work?</h2>
    <p style="color:var(--muted); margin-bottom: 10px;">Follow these steps to get your dictionary app running:</p>

    <div class="step">
      <div class="step-num">1</div>
      <div class="step-content">
        <h3>Install Node.js</h3>
        <p>Download and install Node.js from <strong>nodejs.org</strong>. This gives you the <code>node</code> command in your terminal.</p>
      </div>
    </div>
    <div class="step">
      <div class="step-num">2</div>
      <div class="step-content">
        <h3>Open Your Terminal</h3>
        <p>Open Command Prompt (Windows), Terminal (macOS/Linux), or the integrated terminal in VS Code.</p>
      </div>
    </div>
    <div class="step">
      <div class="step-num">3</div>
      <div class="step-content">
        <h3>Navigate to Your Project</h3>
        <p>Use <code>cd dictionary-app</code> to move into the folder containing <code>server.js</code> and <code>dictionary.html</code>.</p>
      </div>
    </div>
    <div class="step">
      <div class="step-num">4</div>
      <div class="step-content">
        <h3>Run the Command</h3>
        <p>Type <code>node server.js</code> and press Enter. Your server starts and serves <code>dictionary.html</code> at <code>http://localhost:3000</code>!</p>
      </div>
    </div>
  </div>
</section>

<section class="section" id="code">
  <div class="container">
    <h2 class="section-title"><span class="emoji">&#x1F50D;</span> Code Breakdown</h2>

    <div class="code-block">
      <div class="code-header"><span class="dot dot-r"></span><span class="dot dot-y"></span><span class="dot dot-g"></span> Terminal</div>
      <pre>The command explained piece by piece:

node         -- The Node.js runtime executable
server.js    -- The file Node.js will execute</pre>
    </div>

    <details>
      <summary>What does server.js look like inside?</summary>
      <div class="details-body">
        <div class="code-block">
          <div class="code-header"><span class="dot dot-r"></span><span class="dot dot-y"></span><span class="dot dot-g"></span> server.js</div>
          <pre>// Load the built-in HTTP module
var http = require('http');
// Load the file system module
var fs = require('fs');
// Load the path module
var path = require('path');

// Create the server
var server = http.createServer(function(req, res) {
  // Build the file path to dictionary.html
  var filePath = path.join(__dirname, 'dictionary.html');
  // Read and serve the file
  fs.readFile(filePath, function(err, data) {
    res.writeHead(200, { 'Content-Type': 'text/html' });
    res.end(data);
  });
});

// Start listening on port 3000
server.listen(3000, function() {
  console.log('Server running at http://localhost:3000');
});</pre>
        </div>
      </div>
    </details>
  </div>
</section>

<section class="section" id="demo">
  <div class="container">
    <h2 class="section-title"><span class="emoji">&#x1F3AC;</span> Live Demo Walkthrough</h2>
    <div class="card">
      <p><span class="badge badge-blue">Simulated Terminal</span></p>
      <div class="code-block">
        <div class="code-header"><span class="dot dot-r"></span><span class="dot dot-y"></span><span class="dot dot-g"></span> Terminal Session</div>
        <pre>-- Step 1: Navigate to the project folder
$ cd ~/projects/dictionary-app

-- Step 2: Run the server
$ node server.js
Server running at http://localhost:3000

-- Step 3: Open your browser and visit:
--    http://localhost:3000
-- You will see dictionary.html served!

-- Step 4: To stop the server, press:
$ Ctrl + C</pre>
      </div>
    </div>
  </div>
</section>

<section class="section" id="mistakes">
  <div class="container">
    <h2 class="section-title"><span class="emoji">&#x1F6AB;</span> Common Mistakes</h2>

    <div class="mistake">
      <div class="mistake-icon">&#x274C;</div>
      <div>
        <h4>Running from the wrong directory</h4>
        <p>If you are not in the folder containing <code>server.js</code>, you will get <code>Error: Cannot find module</code>. Always <code>cd</code> into the project folder first!</p>
      </div>
    </div>
    <div class="mistake">
      <div class="mistake-icon">&#x274C;</div>
      <div>
        <h4>Node.js not installed</h4>
        <p>Typing <code>node server.js</code> without Node.js installed will show <code>node is not recognized</code>. Install it from nodejs.org first.</p>
      </div>
    </div>
    <div class="mistake">
      <div class="mistake-icon">&#x274C;</div>
      <div>
        <h4>Port already in use</h4>
        <p>If another app is using port 3000, you will see <code>EADDRINUSE</code>. Stop the other app or change the port in <code>server.js</code>.</p>
      </div>
    </div>
    <div class="mistake">
      <div class="mistake-icon">&#x274C;</div>
      <div>
        <h4>Typing node server (without .js)</h4>
        <p>While Node.js can sometimes resolve it, always include the <code>.js</code> extension to be safe and explicit.</p>
      </div>
    </div>
  </div>
</section>

<section class="section" id="tips">
  <div class="container">
    <h2 class="section-title"><span class="emoji">&#x1F3C6;</span> Pro Tips</h2>

    <div class="pro-tip">
      <div class="pro-tip-icon">&#x1F4A1;</div>
      <div>
        <h4>Use nodemon for auto-restart</h4>
        <p>Install <code>nodemon</code> globally with <code>npm i -g nodemon</code>, then run <code>nodemon server.js</code>. It auto-restarts when you change files!</p>
      </div>
    </div>
    <div class="pro-tip">
      <div class="pro-tip-icon">&#x1F4A1;</div>
      <div>
        <h4>Use Express.js for easier routing</h4>
        <p>Instead of the bare <code>http</code> module, use Express: <code>npm i express</code>. It simplifies serving files.</p>
      </div>
    </div>
    <div class="pro-tip">
      <div class="pro-tip-icon">&#x1F4A1;</div>
      <div>
        <h4>Add a start command to package.json</h4>
        <p>Add a start entry in your <code>package.json</code>. Then you only need to type <code>npm start</code>!</p>
      </div>
    </div>
  </div>
</section>

<section class="section" id="quiz">
  <div class="container">
    <h2 class="section-title"><span class="emoji">&#x1F9E0;</span> Practice Quiz</h2>
    <p style="color:var(--muted); margin-bottom: 20px;">Test what you have learned! Select the correct answer for each question.</p>

    <div class="card quiz-q">
      <h3>1. What does the command <code>node server.js</code> do?</h3>
      <input type="radio" name="q1" id="q1a">
      <input type="radio" name="q1" id="q1b">
      <input type="radio" name="q1" id="q1c">
      <label for="q1a">A) Opens server.js in a text editor</label>
      <label for="q1b">B) Runs the server.js file using the Node.js runtime</label>
      <label for="q1c">C) Installs Node.js on your computer</label>
      <div class="quiz-feedback quiz-correct fb-q1-correct">Correct! <code>node server.js</code> runs the file using the Node.js runtime.</div>
      <div class="quiz-feedback quiz-wrong fb-q1-wrong">Not quite. <code>node</code> is the runtime and <code>server.js</code> is the file it runs. Try again!</div>
    </div>

    <div class="card quiz-q">
      <h3>2. What should you do BEFORE running <code>node server.js</code>?</h3>
      <input type="radio" name="q2" id="q2a">
      <input type="radio" name="q2" id="q2b">
      <input type="radio" name="q2" id="q2c">
      <label for="q2a">A) Navigate to the project directory containing server.js</label>
      <label for="q2b">B) Delete the node_modules folder</label>
      <label for="q2c">C) Close all browser windows</label>
      <div class="quiz-feedback quiz-correct fb-q2-correct">Correct! You must <code>cd</code> into the project folder first!</div>
      <div class="quiz-feedback quiz-wrong fb-q2-wrong">Nope! The key step is navigating to the right directory with <code>cd</code>.</div>
    </div>

    <div class="card quiz-q">
      <h3>3. How do you stop a running Node.js server?</h3>
      <input type="radio" name="q3" id="q3a">
      <input type="radio" name="q3" id="q3b">
      <input type="radio" name="q3" id="q3c">
      <label for="q3a">A) Close the browser window</label>
      <label for="q3b">B) Type exit in the browser</label>
      <label for="q3c">C) Press Ctrl + C in the terminal</label>
      <div class="quiz-feedback quiz-correct fb-q3-correct">Correct! Ctrl + C sends an interrupt signal to stop the server.</div>
      <div class="quiz-feedback quiz-wrong fb-q3-wrong">Not quite. You need to press Ctrl + C in the terminal where the server is running.</div>
    </div>
  </div>
</section>

<section class="section" id="summary">
  <div class="container">
    <h2 class="section-title"><span class="emoji">&#x1F4CB;</span> Summary Card</h2>
    <div class="summary-card">
      <h3>Quick Reference Cheat Sheet</h3>
      <ul>
        <li><strong>Command:</strong> <code>node server.js</code></li>
        <li><strong>Purpose:</strong> Start a Node.js server to serve <code>dictionary.html</code></li>
        <li><strong>Prerequisite:</strong> Install Node.js from nodejs.org</li>
        <li><strong>Navigate first:</strong> <code>cd dictionary-app</code></li>
        <li><strong>Access in browser:</strong> <code>http://localhost:3000</code></li>
        <li><strong>Stop server:</strong> Press <code>Ctrl + C</code> in terminal</li>
        <li><strong>Auto-restart tip:</strong> Use <code>nodemon server.js</code></li>
        <li><strong>Better framework:</strong> Use Express.js for more features</li>
      </ul>
    </div>
  </div>
</section>

<footer>
  <p>Generated by <span class="brand">AI Prompt Dictionary</span> &#8226; Made with &#x1F49C; for learners everywhere</p>
  <p>Keep learning, keep building! You are doing amazing.</p>
</footer>

</body>
</html>
Live Preview