main.js
// This serves up the webpage itself
This serves up the webpage itself
This serves up the webpage itself
function sendPage(res) {
  var d = `
  <!DOCTYPE html>
  <html lang="en">
  <head>
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Wifi Client Configuration</title>
  </head>
  <body>
    <style>
      label {
        display: block;
        padding: 5px;
      }
    </style>
    <h1>Wifi Client Configuration</h1>
    <form action="/" method="post">
      <label for="ssid">Network Name
        <input type="text" name="s" id="ssid">
      </label>
      <label for="password">Password
        <input type="text" name="p" id="password">
      </label>
      <label for="nodecode">Node Code
        <input type="text" name="c" id="nodecode">
      </label>
      <div>
        <button>Save</button>
      </div>
    </form>    
  </body>
  </html>`;
  res.writeHead(200, {
    "Content-Type": "text/html",
    "Content-Length": d.length
  });
  res.end(d);
}
function sendPage ( res ) { var d = ` ` ; res . writeHead ( 200 , { "Content-Type" : "text/html" , "Content-Length" : d . length } ) ; res . end ( d ) ; }
This serves up the webpage itself
This serves up the webpage itself
// We're using ES6 Template Literals here to make the HTML easy to read.