Skip to content

feat: implementa case-transformer server e documentação completa#1084

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

feat: implementa case-transformer server e documentação completa#1084
glauccoeng-prog wants to merge 1 commit intomate-academy:masterfrom
glauccoeng-prog:develop

Conversation

@glauccoeng-prog
Copy link

No description provided.

Copilot AI review requested due to automatic review settings March 21, 2026 00:05
Copy link

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

Implements the Node.js HTTP server for the “case-transformer” exercise, wiring URL parsing + validation to the existing convertToCase business logic, and updates project documentation/tooling.

Changes:

  • Implemented createServer() to parse req.url, validate textToConvert/toCase, and return JSON responses.
  • Refined README formatting around requirements/validation/response examples.
  • Updated dev tooling dependency (@mate-academy/scripts) and added a GitHub Actions workflow template.

Reviewed changes

Copilot reviewed 4 out of 5 changed files in this pull request and generated 3 comments.

Show a summary per file
File Description
src/createServer.js Adds the HTTP server implementation, validations, and JSON responses delegating conversion to convertToCase.
README.md Minor documentation formatting adjustments (spacing/JSON example formatting).
package.json Bumps @mate-academy/scripts version.
package-lock.json Lockfile updates corresponding to the scripts dependency bump.
.github/workflows/test.yml-template Adds a CI workflow template for running tests on PRs.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment on lines +10 to +22
// A resposta deve ser sempre retornada em formato JSON
res.setHeader('Content-Type', 'application/json');

// Separa a URL em duas partes: o caminho da rota principal
// (pathname) e os eventuais parâmetros (queryString)
const [pathname, queryString] = req.url.split('?');
// Remove o caracter '/' inicial para isolar apenas o texto
// que a api vai converter
const textToConvert = pathname.slice(1);

// Usa a classe URLSearchParams (nativa do node) para processar
// os parâmetros enviados de forma fácil
const params = new URLSearchParams(queryString || '');
Copy link

Copilot AI Mar 21, 2026

Choose a reason for hiding this comment

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

The inline comments in this file are written in Portuguese, while the rest of the repository’s source/docs are in English (e.g., JSDoc in src/convertToCase/* and README). For consistency and easier maintenance across the team, please translate these comments to English (or remove non-essential comments).

Copilot uses AI. Check for mistakes.
Comment on lines +16 to +23
steps:
- uses: actions/checkout@v2
- name: Use Node.js ${{ matrix.node-version }}
uses: actions/setup-node@v1
with:
node-version: ${{ matrix.node-version }}
- run: npm install
- run: npm test
Copy link

Copilot AI Mar 21, 2026

Choose a reason for hiding this comment

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

The added workflow YAML is invalidly indented: under steps: the list items must be indented further (e.g., steps:\n - uses: ...). As written, GitHub Actions will fail to parse it. Also, consider updating to supported action versions (checkout@v4, setup-node@v4) and aligning the branch filter with the repo default (this repo appears to use main, not master).

Copilot uses AI. Check for mistakes.
Comment on lines 18 to 22
"devDependencies": {
"@mate-academy/eslint-config": "latest",
"@mate-academy/scripts": "^1.8.6",
"@mate-academy/scripts": "^2.1.3",
"eslint": "^8.57.0",
"eslint-plugin-jest": "^28.6.0",
Copy link

Copilot AI Mar 21, 2026

Choose a reason for hiding this comment

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

This PR’s title/goal is implementing the server and documentation, but it also bumps @mate-academy/scripts from ^1.8.6 to ^2.1.3. That upgrade can change lint/test behavior and Node version requirements (package-lock shows deps with node >= 18). If this upgrade isn’t required for the feature, please revert it (and the corresponding package-lock changes) to keep the PR focused; otherwise, document the reason in the PR description.

Copilot uses AI. Check for mistakes.
Copy link

@raulriato raulriato left a comment

Choose a reason for hiding this comment

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

Your code looks fine. Just a tip for next projects:

It's not good practice to leave comments on the final code.

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.

3 participants