Untitled Lesson
Skill Matrix
UNLOCK NODES BY LEARNING NEW TAGS.
According to RESTful design principles, what is the correct URL and HTTP method combination to retrieve a specific user with ID 42?
💻 Code Challenge | +75 XP
Write the Node.js/Backend code snippet to implement a Node REST APIs pipeline. Include the setup and basic execution steps.
You are reviewing a Node REST APIs pipeline and the output is incorrect. Reorder the following pipeline stages in the correct logical order to fix the bug: Input Data, Process, Output.
Task: Reorder the blocks in logical sequence to solve the problem.
A.D.A. Interface
Adaptive Didactic Assistant

Pascual Vila
Frontend Instructor // Code Syllabus
The Error //
Using verbs in URLs instead of letting the HTTP method express the action
// Wrong: RPC-style verb in the path
app.get('/getAllUsers', handler);
app.post('/createUser', handler);
// Correct: noun resource, verb comes from the HTTP method
app.get('/users', handler);
app.post('/users', handler);The Solution //
Endpoints like /getUsers or /deleteUser?id=5 duplicate the intent already carried by the HTTP method, breaking the uniform interface constraint and confusing anyone consuming the API who expects REST conventions. Resources should be nouns (/users, /users/:id) and the verb should come entirely from GET/POST/PUT/PATCH/DELETE.
The Error //
Returning 200 OK for every response regardless of what actually happened
// Wrong: client must inspect the body to know it failed
res.status(200).json({ success: false, error: 'User not found' });
// Correct: status code carries the real meaning
res.status(404).json({ error: 'User not found' });The Solution //
An API that always responds with 200, even for validation failures or missing resources, forces every client to parse the response body just to know if the request succeeded, defeating the point of standard HTTP status codes and breaking HTTP-aware tooling (caches, monitoring, retries). Use 201 for creation, 204 for empty successful deletes, 400/422 for validation errors, 404 for missing resources, and 401/403 for auth failures.