achhayapathak / termtalk

Npm package to securely chat with your friend through your CLI.
https://www.npmjs.com/package/termtalk
MIT License
2 stars 1 forks source link

completed issue #16 #18

Closed yashkathe closed 3 months ago

yashkathe commented 3 months ago

Fixed #16

achhayapathak commented 3 months ago

Please make the changes on the client side as the port is hardcoded as well, merging this will break the application.

achhayapathak commented 3 months ago

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.

achhayapathak commented 3 months ago

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!

yashkathe commented 3 months ago

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

yashkathe commented 3 months ago
achhayapathak commented 3 months ago

The code looks good to me, have you tried to run this locally? Was it working as expected?

yashkathe commented 3 months ago

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