Day 1 of #100DaysOfLearning

Today I worked on my homework that required me to use socket.io to make a real time todo list.

The important part of the server code consisted of:

I initially had a lot of socket.io connection errors because I jumped right into the code and forgot to properly initialize the socket correctly! So next time I have to make sure that I do that for the http.

The function is pretty straight forward. When the socket emits the “add new item” event on the client, the socket will emit the whatever the original socket has emitted to the rest of the other sockets.

The app.js code was a little more complicated so I won’t go through it in detail. I just wanted to write something that I learned today no matter how small it is so there you go!