JavaScript
Create the UI
Create the user interface for your web chat.
The following HTML defines a <section> that you will use to display:
- The name of the currently logged-in user
- The user's current status - that is, whether they are currently typing a message
- The messages sent and received so far
- A text area for your user to type a new message
The web page loads three scripts once the page body has rendered:
- The
nexmoClient.jsfile from thenexmo-clientNode module - The
chat.jsfile that will contain your application's code. Create this empty file in the project's root directory
Create a file named index.html in your project directory with the following contents:
Creating a web-based chat app
Create a web application that enables users to message each other
Steps
1
Introduction to this task2
Prerequisites3
Create a Vonage Application4
Create a conversation5
Create the users6
Add users to the conversation7
Generate JWTs8
Create the UI9
Authenticate your Users10
Fetch the conversation11
Show the message history12
Send a message13
Add typing indicators14
Run your application15
What's next?