Skip to content

chat-app#101

Open
Csillag61 wants to merge 2 commits into
mate-academy:masterfrom
Csillag61:develop
Open

chat-app#101
Csillag61 wants to merge 2 commits into
mate-academy:masterfrom
Csillag61:develop

Conversation

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

Thank you for your hard work! However, there is a critical issue with inconsistent CORS configuration and port usage between your frontend and backend. The frontend connects to 'http://localhost:3000', but your backend CORS settings and manual headers use both 'http://localhost:3000' and 'http://localhost:3001'. This mismatch will cause CORS errors and prevent your chat app from working as intended. Please ensure both the frontend and backend use the same port and that all CORS origins are consistent across your server configuration and manual headers. Once you fix this, your app should work smoothly! 😊 Keep going—you’re almost there!


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

Important

Fix the issues, commit the changes, and then re-request my review using the Re-request review button2 in the Reviewers tab.

Tip

If you have any comments about this review, please leave a message in the Add a comment section below and mention me with the @mateacademy-ai-mentor tag3.
I will read your message during my next review of your pull request. Please do not reply directly to my comments, as that feature is not supported yet.

Caution

Do not close the pull request until the review is complete. Closing it early can lead to unexpected behavior and disrupt the review process.

Footnotes

  1. Rate AI review example

  2. Re-request AI review example

  3. Add AI review comments example

Comment thread server/server.js
app.use(express.urlencoded({ extended: true }));
app.use(express.static('public')); // Serve static files from the public directory
app.use((req, res, next) => {
res.header('Access-Control-Allow-Origin', 'http://localhost:3000');
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Issue: The manual 'Access-Control-Allow-Origin' header is set to 'http://localhost:3000', while the CORS middleware and Socket.IO CORS are set to 'http://localhost:3001'.

This inconsistency can cause CORS errors if your frontend is not running on the same port as specified here. Please ensure all CORS origins match your actual frontend URL as required by the task description and checklist.

import io from 'socket.io-client';
import './ChatApp.css';

const socket = io('http://localhost:3000', {
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Issue: The socket is connecting to 'http://localhost:3000', but your server's CORS settings and manual headers are inconsistent (some use port 3000, others 3001).

This can lead to CORS errors or connection failures. Please verify which port your frontend is running on and ensure both the client and server use the same port in their configuration, as required by the task description and checklist.

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

Great job! 🎉 Your implementation meets all the core requirements for the chat application. The CORS configuration, port consistency, backend chat logic, and frontend integration are all correct and complete. There are no critical issues or missing files, and your code is well-structured and ready to go. Keep up the excellent work! If you want to further improve, consider reviewing best practices and code style for future projects, but for this task, you’re all set. 🚀


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

Footnotes

  1. Rate AI review example

@guapi212
Copy link
Copy Markdown

Hola que tal?

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