Closed yashkathe closed 3 months ago
Please make the changes on the client side as the port is hardcoded as well, merging this will break the application.
Also, the port no should be greater than 1025. Ports from 1 to 1025 are reserved by the system, you can read more about this.
Also, can you create a function which has all the logic of port validation and server creation? You can create a separate file to store this function and import it into server.js file. Functional programming is a very standard practice in software development and as a rule of thumb, we don't exceed the number of lines more than 100 in a single file. As server.js is our main file for hosting the server it will be good to write functions and import them already as it is easy to read and maintain. You can take inspiration from the client folder. Also, try to add some comments so that it's easier to onboard others. Thanks!
Also, can you create a function which has all the logic of port validation and server creation? You can create a separate file to store this function and import it into server.js file. Functional programming is a very standard practice in software development and as a rule of thumb, we don't exceed the number of lines more than 100 in a single file. As server.js is our main file for hosting the server it will be good to write functions and import them already as it is easy to read and maintain. You can take inspiration from the client folder. Also, try to add some comments so that it's easier to onboard others. Thanks!
Sure, I'll create a separate function
The code looks good to me, have you tried to run this locally? Was it working as expected?
The code looks good to me, have you tried to run this locally? Was it working as expected?
Yes, everything works as expected. I tested and then committed the code
Fixed #16