Skip to content

Instantly share code, notes, and snippets.

@martimatix
Last active October 9, 2016 03:31
Show Gist options
  • Save martimatix/67d7e3162544909f1ebbdeba006d0980 to your computer and use it in GitHub Desktop.
Save martimatix/67d7e3162544909f1ebbdeba006d0980 to your computer and use it in GitHub Desktop.
Initialisation code for crystal-elm-chat
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>Elm Crystal Chat Proof of Concept</title>
<script src="elm.js"></script>
</head>
<body>
<script type="text/javascript">
const websocketProtocol = location.protocol === 'https:' ? 'wss:' : 'ws:';
const websocketHost = `${websocketProtocol}//${location.host}/chat`;
Elm.Main.fullscreen({
websocketHost: websocketHost
});
</script>
</body>
</html>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment