-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathmain.go
54 lines (42 loc) · 1.31 KB
/
main.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
package main
import (
"html/template"
"net/http"
)
var tpl *template.Template
var x string
func init() {
tpl = template.Must(template.ParseGlob("templates/*"))
}
func main() {
http.HandleFunc("/", index)
http.HandleFunc("/dataanalyst", dataanalyst)
http.HandleFunc("/hud_responders", hud_responders)
http.HandleFunc("/icqa", icqa)
http.HandleFunc("/learning", learning)
http.HandleFunc("/palletsearch", palletsearch)
http.HandleFunc("/test", test)
http.Handle("/public/", http.StripPrefix("/public/", http.FileServer(http.Dir("public"))))
http.ListenAndServe(":80", nil)
}
func index(w http.ResponseWriter, r *http.Request) {
tpl.ExecuteTemplate(w, "index.gohtml", nil)
}
func dataanalyst(w http.ResponseWriter, r *http.Request) {
tpl.ExecuteTemplate(w, "dataanalyst.gohtml", nil)
}
func hud_responders(w http.ResponseWriter, r *http.Request) {
tpl.ExecuteTemplate(w, "hud_responders.gohtml", nil)
}
func icqa(w http.ResponseWriter, r *http.Request) {
tpl.ExecuteTemplate(w, "icqa.gohtml", nil)
}
func learning(w http.ResponseWriter, r *http.Request) {
tpl.ExecuteTemplate(w, "learning.gohtml", nil)
}
func palletsearch(w http.ResponseWriter, r *http.Request) {
tpl.ExecuteTemplate(w, "palletsearch.gohtml", nil)
}
func test(w http.ResponseWriter, r *http.Request) {
tpl.ExecuteTemplate(w, "test.gohtml", nil)
}