gitstack

demo/acme-pay code browser

561 B Go 22 lines 2024-01-18 · 5a39e83 raw
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
package ui

import "net/http"

// LoginPage serves the HTML login form at GET /login.
func LoginPage(w http.ResponseWriter, r *http.Request) {
	w.Header().Set("Content-Type", "text/html; charset=utf-8")
	w.Write([]byte(loginHTML))
}

const loginHTML = `<!DOCTYPE html>
<html>
<head><title>Login</title></head>
<body>
  <form method="POST" action="/login">
    <label>Username: <input name="username" type="text"></label>
    <label>Password: <input name="password" type="password"></label>
    <button type="submit">Sign in</button>
  </form>
</body>
</html>
`