Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

server #820

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open

server #820

wants to merge 1 commit into from

Conversation

OMedvid
Copy link

@OMedvid OMedvid commented Dec 28, 2024

No description provided.

Copy link

@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.

Great job on implementing the task requirements! 🎉 Your code is well-structured and meets all the core functionalities. While there are a couple of minor suggestions, such as ensuring toCase is valid before using it and following naming conventions, these do not impact the functionality. Keep up the good work and consider these suggestions for future improvements! 😊

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

return http.createServer((req, res) => {
const url = new URL(req.url, `http://${req.headers.host}`);
const toCase = url.searchParams.get('toCase');
const PATH = url.pathname.slice(1);

Choose a reason for hiding this comment

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

Consider renaming the PATH variable to path to follow JavaScript naming conventions, which typically use camelCase for variable names.

return res.end();
}

const text = convertToCase(PATH, toCase.toUpperCase());

Choose a reason for hiding this comment

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

Ensure that toCase is not null or undefined before calling toUpperCase() to avoid potential runtime errors. This is already checked earlier, but it's good practice to ensure the variable is valid before using it.

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