<!DOCTYPE HTML>
<html>
<head>
  <meta charset="UTF-8">
  <title>Main</title>
  <script src="elm.js"></script>
</head>

<body>
  <div id="elm"></div>
  <script>
  var app = Elm.Main.init({
    node: document.getElementById('elm')
  });

  app.ports.asyncPort.subscribe(function(word) {
    setTimeout(() => {
      app.ports.portSubscription.send(`Thanks for the message: ${word}!`)
    }, 10)
  })

  app.ports.syncPort.subscribe(function(word) {
    app.ports.portSubscription.send(`Thanks for the message: ${wo