Sequence NODE_241
Easy

Create Basic Express Server

Express.js
Node.js
Technical Specification

Set up a basic Express server with a single GET / route that returns a JSON welcome message.

Input/Output Samples
Input:GET /
Output:{ "message": "Welcome to Express API" }
Optimal Logic Path
const express = require("express");
const app = express();
const PORT = process.env.PORT || 3000;

app.get("/", (req, res) => {
  res.json({ message: "Welcome to Express API" });
});

app.listen(PORT, () => {
  console.log("Server listening on port", PORT);
});
Architectural Deep-Dive
We create an Express app, define a route handler for GET /, and listen on a given port.