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 2: Basic Express Server Setup

User Story: As a developer, I want to create a basic Express server so that I can handle web requests for my Mad Libs application.

What You’ll Do

Create a basic Express server that listens on port 3000.

Instructions

💡 Code Hints

Need help with Express setup? Check out these snippets:

Show Me: the basic Express server structure
const express = require('express');
const app = express();
const PORT = 3000;

app.listen(PORT, () => {
    console.log(`Server running on http://localhost:${PORT}`);
});
Show Me: a simple route example
app.get('/', (req, res) => {
    res.send('Hello World!');
});

✅ Check

  1. Run npm install to install dependencies
  2. Run npx nodemon server.js to start your server
  3. Open your browser to http://localhost:3000
  4. You should see “Hello World” displayed
  5. If you see errors, check your server.js file and dependencies