forked from xlvector/caspercloud
-
Notifications
You must be signed in to change notification settings - Fork 0
/
ci.go
62 lines (57 loc) · 1.74 KB
/
ci.go
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
package ci
import (
"fmt"
"net/http"
)
func init() {
http.HandleFunc("/hello", func(w http.ResponseWriter, req *http.Request) {
query := req.URL.Query().Get("query")
html := fmt.Sprintf("<html><head><title>Hello World</title></head><body><h1>Hello World</h1><p id=\"query\">%s</p></body></html>\n", query)
fmt.Fprint(w, html)
})
http.HandleFunc("/form/init", func(w http.ResponseWriter, req *http.Request) {
html := `
<html>
<head>
<title>Input Phone</title>
</head>
<body>
<form action="/form/phone">
<input type="text" id="phone" name="phone" />
<input type="submit" value="submit" id="submit" />
</form>
</body>
</html>
`
fmt.Fprint(w, html)
})
http.HandleFunc("/form/phone", func(w http.ResponseWriter, req *http.Request) {
html := `
<html>
<head>
<title>Input Verify Code</title>
</head>
<body>
<form action="/form/verify_code">
<input type="text" id="verify_code" name="verify_code" />
<input type="submit" value="submit" id="submit" />
</form>
</body>
</html>
`
fmt.Fprint(w, html)
})
http.HandleFunc("/form/verify_code", func(w http.ResponseWriter, req *http.Request) {
html := `
<html>
<head>
<title>Input Verify Code</title>
</head>
<body>
<h1>Thanks</h1>
</body>
</html>
`
fmt.Fprint(w, html)
})
}