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"
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>
`
|