Finished server-side node code for chatroom application