How to do it...

In this recipe, we will create a simple HTML form that has two input fields and a button to submit the form. Perform the following steps:

  1. Create login-form.html inside the templates directory, as follows:
$ mkdir templates && cd templates && touch login-form.html
  1. Copy the following content to login-form.html:
<html>  <head>    <title>First Form</title>  </head>  <body>    <h1>Login</h1>    <form method="post" action="/login">      <label for="username">Username</label>      <input type="text" id="username" name="username">      <label for="password">Password</label>      <input type="password" id="password" name="password">      <button type="submit">Login</button>    </form>  </body></html>

The preceding template has two textboxes—username and password—along ...

Get Go Web Development Cookbook now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.