codex-lv3-may-2025

Level Navigation: 1 2 3 4 5 6 7 8 9 10⚡ 11⚡ 12⚡ 13⚡ 14⚡ 15 16 17 18⚡ 19 20

Level 3: Static File Serving

User Story: As a developer, I want to serve HTML files from my server so that users can access my Mad Libs form in a web browser.

What You’ll Do

Set up static file serving to serve HTML files from the public directory.

Instructions

💡 Code Hints

Need help with static files? Check out these snippets:

Show Me: how to add static middleware
app.use(express.static('public'));
Show Me: basic HTML structure
<!DOCTYPE html>
<html>
<head>
    <title>Mad Libs Form</title>
</head>
<body>
    <h1>Welcome to Mad Libs!</h1>
</body>
</html>

✅ Check

  1. Create public/mad-libs-form.html with basic HTML
  2. Add static middleware to your server
  3. Restart your server
  4. Navigate to http://localhost:3000/mad-libs-form.html
  5. You should see your HTML page instead of “Hello World”