Building the client
When building the client, there are three files we'll be editing; let's quickly list these to make referencing them later much easier:
views/index.ejs
: The HTML that will be delivered by our server to the browser. It loads the page structure, the JavaScript, and the required CSS. We'll refer to this as the HTML file.public/css/style.css
: The style file where we'll put all our CSS declarations, the style (or CSS) file.public/scripts/xmpp.js
: The file where we'll put all our JavaScript for the client, our JavaScript file.
We'll build these files slowly so that each part is understood as we go along.
Connecting anonymously
The first thing we should do is remove all the unnecessary functions within our JavaScript file, so delete the following functions:
handleItems
getNodeItems
discoverBuddycloudServer
The great thing is that the skeleton project already has an anonymous login setup in place for us, so we can just edit it to match our requirements. The login function should look...