TGViewer
Web Development Web Development @webdevcoursefree · 79.6K subscribers
Post #3564 4.56K
Now, let's move to the next topic in Web Development Roadmap:

🌐 Backend Basics — Node.js Express

Now you move from frontend (React) → backend (server side).

Frontend = UI, Backend = Logic + Database + APIs.

🟢 What is Node.js ❓
• Node.js is a JavaScript runtime that runs outside the browser.
• Built on Chrome V8 engine, allows JavaScript to run on server.

🧠 Why Node.js is Popular
• Same language (JS) for frontend + backend
• Fast and lightweight
• Large ecosystem (npm)
• Used in real companies

⚡ How Node.js Works
• Single-threaded, event-driven, non-blocking I/O
• Handles many requests efficiently, good for APIs, real-time apps, chat apps

📦 What is npm
• npm = Node Package Manager
• Used to install libraries, manage dependencies, run scripts

Example: npm install express

🚀 What is Express.js ❓
• Express is a minimal web framework for Node.js.
• Makes backend development easy, clean routing, easy API creation, middleware support

🧩 Basic Express Server Example
• Install Express: npm init -y, npm install express
• Create server.js:
const express = require("express");
const app = express();
app.get("/", (req, res) => {
res.send("Hello Backend");
});
app.listen(3000, () => {
console.log("Server running on port 3000");
});

• Creates server, handles GET request, sends response, listens on port 3000

🔄 What is an API
• API = Application Programming Interface
• Frontend talks to backend using APIs, usually in JSON format

🧠 Common HTTP Methods (Backend)
• GET: Fetch data
• POST: Send data
• PUT: Update data
• DELETE: Remove data

⚠️ Common Beginner Mistakes
• Forgetting to install express
• Not using correct port
• Not sending response
• Confusing frontend and backend

🧪 Mini Practice Task
• Create basic Express server
• Create route /about
• Create route /api/user returning JSON
• Start server and test in browser

✅ Mini Practice Task – Solution 🌐

🟢 Step 1️⃣ Install Express
Open terminal inside project folder:
npm init -y
npm install express


✔ Creates package.json
✔ Installs Express framework

📄 Step 2️⃣ Create server.js

Create a file named server.js and add:

const express = require("express");
const app = express();

// Home route
app.get("/", (req, res) => {
res.send("Welcome to my server");
});

// About route
app.get("/about", (req, res) => {
res.send("This is About Page");
});

// API route returning JSON
app.get("/api/user", (req, res) => {
res.json({ name: "Deepak", role: "Developer", age: 25 });
});

// Start server
app.listen(3000, () => {
console.log("Server running on http://localhost:3000");
});


▶️ Step 3️⃣ Start the Server
Run in terminal:
node server.js


You should see: Server running on http://localhost:3000

🌍 Step 4️⃣ Test in Browser
Open these URLs:
• http://localhost:3000/ → Welcome message
• http://localhost:3000/about → About page text
• http://localhost:3000/api/user → JSON response

Double Tap ♥️ For More
  • ❤ 17
  • 👍 1
  • 🔥 1
More from @webdevcoursefree
  1. Oct 14, 2026🌐 Web Development Roadmap — Part 17 HTML Images — <img> Tag Images make webpages more vis…
  2. Oct 13, 2026𝗧𝗢𝗣 𝗙𝗥𝗘𝗘 𝗖𝗢𝗨𝗥𝗦𝗘𝗦 𝗧𝗢 𝗕𝗢𝗢𝗦𝗧 𝗬𝗢𝗨𝗥 𝗦𝗞𝗜𝗟𝗟𝗦 𝗜𝗡 𝟮𝟬𝟮𝟲! Explor…
  3. Oct 12, 2026For example: Go to Profile → <a> Submit Form → <button> Open Article → <a> Delete Account…
  4. Oct 12, 2026🌐 Web Development Roadmap — Part 16 HTML Links — Tag Links are one of the most important…
  5. Oct 12, 2026🚀 𝗪𝗵𝗶𝗰𝗵 𝗧𝗲𝗰𝗵 𝗦𝗸𝗶𝗹𝗹 𝗪𝗶𝗹𝗹 𝗬𝗼𝘂 𝗠𝗮𝘀𝘁𝗲𝗿 𝗶𝗻 𝟮𝟬𝟮𝟲? Want to buil…
  6. Oct 9, 2026Post #4079
Threads Profile ViewerView any public Threads profile without an account.Open ThreadLook →Writing with AI? Make it sound human.Metric37 rewrites AI drafts so they read naturally. Free AI detector, 1,500 words free.Try Metric37 →