From the course: Scaling Out Using Azure SignalR Service

Unlock the full course today

Join today to access over 23,200 courses taught by industry experts.

Broadcasting messages from the client

Broadcasting messages from the client

- Our client application now is set up to listen for messages from our serverless SignalR Service. Now, let's configure it so we can send messages from our client. In order to send a message to the backend, we have to do it via HTTP request. We need to call the appropriate Azure function that will handle our request and broadcast our message to other clients. Let's navigate to the function which handles sending our messages. Every time the user wants to send a message, we need to make an HTTP request to the messages function. The messages function URL is under the API-based URL which is the main function's URL/API/messages. The method is going to be post and the body is going to be our message object, which has a property for sender, which in our case is going to be our username and the text, which is a text message that the user type. Now, let's send the changes and try this in action. Make sure to reload the page…

Contents