Quantcast
Channel: itp_nyu – Ruta Kruliauskaite @ITP
Viewing all articles
Browse latest Browse all 18

Live chat application with node.js and socket.io

$
0
0

This week’s homework was to get running with node.js on Digital Ocean server, as well as Chat application example with socket.io.

Here it is working:

Screen Shot 2016-02-09 at 12.04.45

The task was to make it “more fun and more interesting”.

Things I wanted to do:

  • do some CSS styling
  • show sent messages on the page, so it looks like an actual chat
  • once messages are shown, make them appear in the right order on both browsers (before it was a bit messy and looked different on two windows)

Here it is running:

Screen Shot 2016-02-09 at 16.44.09

Here how it looks on two browsers:

Screen Shot 2016-02-09 at 16.43.51

My code can be found here on github: TBC (as soon as I learn how to push my files to github). Here is html code without running on a server.

Running on the server: http://162.243.91.221:8080/index-hw.html

Questions I have from this homework:

  1. Is there any way to instantly see changes on the browser while editing the code and without having to upload index-hw.html file to Cyberduck over and over again?
  2. It seems like we installed node modules together with socket.io directly to the folder in Cyberduck, what if I want to have a folder on my desktop: do I have to install node and socket.io all over again?
  3. <div align=”center”> seems not to be working and I had to use margin to put my user input div to the center. It doesn’t seem that comfortable as I might have to change it every time depending on the screen size. Is there anything that could be used instead of align?
  4. I didn’t succeed in making user input box bigger — how should I do it?
  5. When I’m ready to publish application: what url should I give to the public?

Viewing all articles
Browse latest Browse all 18

Trending Articles