Skip to content

Instantly share code, notes, and snippets.

@tomorgan
Created March 16, 2021 20:00
Show Gist options
  • Save tomorgan/0cce1331abed3382b8a4474c1042232e to your computer and use it in GitHub Desktop.
Save tomorgan/0cce1331abed3382b8a4474c1042232e to your computer and use it in GitHub Desktop.
<!DOCTYPE html>
<html>
<head>
<title>Learn ASC Day 15 - Doing Chat in ACS</title>
</head>
<body>
<h2>Learn ASC Day 15 - Doing Chat in ACS</h2>
<p>Your User ID <span style="font-weight: bold" id="userId">-</span></p>
<input id="destination-group-input" type="text" placeholder="Chat Thread ID"
style="margin-bottom:1em; width: 600px;" />
<div>
<button id="connect-button" type="button" disabled="false">
Connect
</button>
<button id="disconnect-button" type="button" disabled="true">
Disconnect
</button>
<button id="createChatThread" type="button" disabled="true">
Create a Chat Thread
</button>
</div>
<ul id="chat-container">
</ul>
<br/>
<input id="chat-input" type="text" placeholder="Type your message" />
<button id="chat-send" type="button" disabled="true">Send</button>
<hr/>
<input id="user-input" type="text" placeholder="User ID" />
<button id="user-add" type="button" disabled="true">Add User</button>
<hr/>
<p style="font-family: sans-serif">Hi, I'm Tom! I hope you found this code sample useful. This sample code comes from a series of blog posts about Azure Communication Services. Links for all blog posts can be found at <a href="https://learnacs.dev" target="_blank" rel="noopener">learnACS.dev</a>. I blog at <a href="https://blog.thoughtstuff.co.uk">thoughtstuff.co.uk</a>. You can also <a href="https://www.youtube.com/c/TomMorganTS?sub_confirmation=1" target="_blank" rel="noopener">subscribe to my YouTube channel</a> for videos about ACS (and much more!). </p>
<h4>Disclaimer: This is a sample. It’s not meant for you to take and use without fully understanding what it’s doing. It’s definitely not meant for production use. You should understand the risks of hosting your own ACS instance and associated web-based entry point on the public internet before proceeding. If you end up sharing your access tokens, or there’s a bug in the code and you end up with a huge hosting bill, or find yourself unwittingly hosting other people’s rooms, you’re on your own. This sample code is provided under the <a href="https://opensource.org/licenses/MIT">MIT license</a>, which you should read in full (it’s 21 LOC).</h4>
<script src="./bundle.js"></script>
</body>
</html>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment