Basic Web Technologies
Exercise: AJAX Requests
The backend chat service provides a REST API at the URL https://chat.distsys.ch/api
.
Replace the mock implementations of the request functions in the JavaScripts of the chat application such that the users and messages are sent to and received from the backend chat service.
Add the following lines of codes to pass the authentication token from the login to the chat page, respectively:
location.href = 'chat.html?authToken=' + authToken;
const authToken = new URLSearchParams(location.search).get('authToken');