7
votes
Accepted
Real time Tic Tac Toe game in Javascript using Socket.IO
Server-side code
Looks pretty good!
However, as discussed in the comments, your server should probably be checking the game state to curtail cheating. As it is, it's pretty easy to "win" by fiddling ...
6
votes
Accepted
Node websockets
In node, throwing an error without catching it will kill the process. This seems to be the primary error handling mode (and based on this it seems you then rely on pm2 to restart the process). This ...
3
votes
NodeJS/Express/socket.io backend
A short review;
Your database related functions should be separated, in my mind your socket methods should only do this:
Normalize parameters your receive like with ...
2
votes
Accepted
Basic chat server and client using WebSocket
In regards to the TODO comment, I would suggest something like this:
...
2
votes
Accepted
An Express route, which renders a page, and makes use of socket.io
Conditional line not in brackets
There is an if statement in queryAPI() without brackets. This impacts readability greatly- ...
2
votes
An Express route, which renders a page, and makes use of socket.io
Linting
The code reads well.
There is one convention you missed: use \s to indicate whitespace.
...
2
votes
Accepted
Await socket Response
You have a few flags (removed, responded) which are almost equivalent and possibly useless. ...
1
vote
Accepted
9X9 Tic Tac Toe variant with frontend in react and backend in python flask_socketio
I'm not fantastic with Typescript; so let's take a look at your Python:
Credentials
app.config['SECRET_KEY'] = 'secret!'
This shouldn't be baked into your code. ...
1
vote
Socket.io Node.js Object Oriented Code Structure Approach
Good comments from @Magnus Jeffs Tovslid that I would like to add to.
It seems like you have at least three logical layers to the user experience. First, you have what you call the ...
1
vote
Socket.io Node.js Object Oriented Code Structure Approach
Just a few comments:
1:
The Room class can quickly become a place to throw in all sorts of functionality, even when it's not needed by all its children.
I would be careful to not put much there at ...
Only top scored, non community-wiki answers of a minimum length are eligible
Related Tags
socket.io × 31javascript × 27
node.js × 23
express.js × 8
chat × 5
python × 3
jquery × 3
html × 3
ecmascript-6 × 3
react.js × 3
flask × 3
object-oriented × 2
mysql × 2
tic-tac-toe × 2
socket × 2
mongodb × 2
client × 2
websocket × 2
beginner × 1
asynchronous × 1
http × 1
angular.js × 1
async-await × 1
server × 1
jsx × 1