HackIndia Logo
HackathonsNewsSkillsGrowth
HackIndia LogoContact: +91 9910125804

General

  • Companies
  • Colleges
  • Board of Advisors
  • Brand Ambassadors
  • FAQ
  • Contact
  • Report a Bug

Hackathons

  • Upcoming Hackathons
  • Judges
  • Mentors
  • Partners
  • Participating Colleges
  • Testimonials

Resources

  • About Us
  • Branding
  • Latest News
  • Growth
  • Skills
  • Builders
  • Ecosystem
  • Forum
  • Ideas
  • Prompt Optimizer
  • Games

© 2026 HackIndia. All rights reserved.

Privacy PolicyTerms of ServiceCode of ConductSitemap

Build 2.139 · 05 Nov 2026, 10:27 UTC

    HackIndia
    HackathonsNewsInternshipsSkillsGrowthPro Perks
    ExpressWorking towardsExpress
    0%

    0 of 10 steps done · +100 XP · +50 SHARP when it is yours

    1. 1Ship Your First Express Route4 min · +10 XP · +5 SHARP
    2. 2Design Routes That Make Sense4 min · +10 XP · +5 SHARP
    3. 3Use Middleware Without Hanging Requests4 min · +10 XP · +5 SHARP
    4. 4Read Bodies, Queries, and Params4 min · +10 XP · +5 SHARP
    5. 5Return Status Codes With Meaning4 min · +10 XP · +5 SHARP
    6. 6Protect Config and Secrets4 min · +10 XP · +5 SHARP
    7. 7Handle Errors in One Place5 min · +10 XP · +5 SHARP
    8. 8Publish Your API Repo4 min · +10 XP · +5 SHARP
    9. The check10 questions, 7 to pass · +10 SHARP
    10. Hand in the taskA project that uses the skill
    11. Skill and certificate+100 XP · +50 SHARP
    Lesson 1 of 8 4 min

    Express

    Ship Your First Express Route

    • +10 XP for this lesson
    • +100 XP when the skill is proved
    • Nobody here has proved it yet
    In 30 seconds
    • Create a small Node.js 24 LTS project with Express 5.
    • Add one GET route that returns JSON.
    Run your API locally and check it in the browser.

    What you build

    You will create the smallest useful backend for this track: one Express app with one route.

    The route will answer GET / with JSON. This is the first proof that your API runs on your laptop and can later be shared in a public repo.

    Key point

    Remember this

    An Express API is a Node app that listens for HTTP requests and sends responses.

    A route connects one HTTP method and one path to one handler function. For example, GET / runs when someone opens the root URL.

    Your to-do

    Create the project

    Do each one yourself, then tap it to tick it off. The ticks are only a checklist for you: they are not marked or scored.

    0 of 5 done

    node -v
    npm init -y
    npm install express
    mkdir src
    Example

    First route

    Put this in src/app.js.

    This uses app.get('/', handler). The get part is the HTTP method. The '/' part is the path. Query strings are not part of the route path; you will handle them in a later lesson.

    import express from 'express';
    
    const app = express();
    const port = 3000;
    
    app.get('/', (req, res) => {
      res.json({
        message: 'Recruiter-ready API is running',
        owner: 'Your Name',
        status: 'ok'
      });
    });
    
    app.listen(port, () => {
      console.log(`API listening on http://localhost:${port}`);
    });
    Your to-do

    Make imports work

    Do each one yourself, then tap it to tick it off. The ticks are only a checklist for you: they are not marked or scored.

    0 of 3 done

    {
      "type": "module",
      "scripts": {
        "dev": "node src/app.js"
      },
      "dependencies": {
        "express": "^5.2.1"
      }
    }
    Tip

    Test like a user

    Run npm run dev. Then open http://localhost:3000 in your browser.

    You should see JSON, not an HTML page. This is normal for an API. Later, your frontend, Postman, curl, or a recruiter’s local machine can call the same route.

    npm run dev
    Common mistake

    Avoid old syntax

    Older tutorials may show Express 4 patterns. Do not copy response shortcuts like res.json(obj, status) or res.send(body, status).

    In Express 5, set the status first when you need one: res.status(201).json(data). For today, the default 200 response is fine.

    Your to-do

    Do this now

    Do each one yourself, then tap it to tick it off. The ticks are only a checklist for you: they are not marked or scored.

    0 of 5 done

    Sources

    Checked against the current documentation on 21 September 2026.

    • Node.js Releases · nodejs.org
    • npm registry express latest · registry.npmjs.org
    • Express routing guide · expressjs.com
    • Express 5 migration guide · expressjs.com

    Quick check

    0 of 2 right
    1.Your app should respond when someone opens http://localhost:3000. Which route matches that request?
    2.You want to return JSON from an Express 5 route. Which style should you use when setting a status?

    Answer the quick check to finish this lesson.

    Skip to lesson 2 →
    Express
    Working towards
    Express +100 XP

    0 of 8 lessons done · proved by a project that uses the skill

    See the track