In the previous post, we loaded three Photos into the Picshare application. Today we will connect to the WebSocket server using Elm. This post is part of the functional language series, and it is based on a remarkable book, Programming Elm Build Safe and Maintainable Front-End Applications by Jeremy Fairbank.
WebSocket protocol enables communication through the same socket in both directions from the client to the server.
ports. In the port module, we define functions with keyword
index.html that will use those
When you are done, import the WebSocket module in Picshare.elm file and compile:
elm make Picshare.elm --output picshare.js
We are redy to connect Picshare application with websocket server.