Bird
0
0

Which Node.js module must you require to create an HTTP server?

easy📝 Conceptual Q2 of 15
Node.js - HTTP Module
Which Node.js module must you require to create an HTTP server?
Ahttp
Burl
Cpath
Dfs
Step-by-Step Solution
Solution:
  1. Step 1: Identify the module for HTTP server

    The http module provides functionality to create HTTP servers in Node.js.
  2. Step 2: Exclude unrelated modules

    fs is for file system, path for file paths, and url for URL parsing, none create servers.
  3. Final Answer:

    http -> Option A
  4. Quick Check:

    Module for HTTP server = http [OK]
Quick Trick: Use require('http') to create servers [OK]
Common Mistakes:
  • Using fs or path modules instead
  • Forgetting to require any module
  • Confusing URL parsing with server creation

Want More Practice?

15+ quiz questions · All difficulty levels · Free

Free Signup - Practice All Questions
More Node.js Quizzes