Skip to content

params-server solution#421

Open
NadiiaBulmak wants to merge 1 commit intomate-academy:masterfrom
NadiiaBulmak:develop
Open

params-server solution#421
NadiiaBulmak wants to merge 1 commit intomate-academy:masterfrom
NadiiaBulmak:develop

Conversation

@NadiiaBulmak
Copy link
Copy Markdown

No description provided.

Copy link
Copy Markdown

@mateacademy-ai-mentor mateacademy-ai-mentor left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Review Summary

Decision: APPROVE

Your HTTP server implementation in src/createServer.js fully meets the task requirements. It correctly uses Node's http module and the WHATWG URL API to parse the pathname and query string, filters out empty path segments, and returns a JSON response with the exact structure { parts: string[], query: Record<string,string> }. The response sets Content-Type: application/json, handles root and empty query cases gracefully, and maintains consistent behavior across methods.

What you did well:

  • Robust URL parsing with new URL(req.url, base) and Object.fromEntries(url.searchParams.entries()) for string-only query values
  • Properly ignoring leading/trailing/repeated slashes when building parts
  • Clean, readable code with no unnecessary complexity

No changes are required. Nice work—this should pass all tests as-is!


✨ Please rate this review in the Platform's notification center1. I will be grateful for your feedback! ✨

Footnotes

  1. Rate AI review example

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants