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:
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:
Here how it looks on two browsers:
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:
- 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?
- 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?
- <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?
- I didn’t succeed in making user input box bigger — how should I do it?
- When I’m ready to publish application: what url should I give to the public?