-
Notifications
You must be signed in to change notification settings - Fork 10
/
Copy pathhandlersprod.go
88 lines (70 loc) · 2.42 KB
/
handlersprod.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
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
// +build !debug
package main
import "net/http"
func handlerMain(w http.ResponseWriter, r *http.Request) {
if r.URL.Path != "/" {
handlerNotFound(w, r)
} else if base.connections[0].client.IsConnected() {
w.Header().Set("Content-Type", "text/html")
w.Write(FileIndexHTML)
} else {
w.Header().Set("Content-Type", "text/html")
w.Write(FileWaitingHTML)
}
}
func handlerJsBundle(w http.ResponseWriter, r *http.Request) {
w.Header().Set("Content-Type", "text/javascript")
w.Write(FileBundleMinJS)
}
func handlerFaviconIco(w http.ResponseWriter, r *http.Request) {
w.Header().Set("Content-Type", "image/x-icon")
w.Write(FileFaviconICO)
}
func handlerBootstrapCSS(w http.ResponseWriter, r *http.Request) {
w.Header().Set("Content-Type", "text/css")
w.Write(FileBootstrapMinCSS)
}
func handlerLayout(w http.ResponseWriter, r *http.Request) {
w.Header().Set("Content-Type", "text/css")
w.Write(FileLayoutMinCSS)
}
func handlerFontAwesomeMinCSS(w http.ResponseWriter, r *http.Request) {
w.Header().Set("Content-Type", "text/css")
w.Write(FileFontAwesomeMinCSS)
}
func handlerFontsFaOTF(w http.ResponseWriter, r *http.Request) {
w.Header().Set("Content-Type", "application/font-otf")
w.Write(FileFontAwesomeOTF)
}
func handlerFontsFaEOT(w http.ResponseWriter, r *http.Request) {
w.Header().Set("Content-Type", "application/font-eot")
w.Write(FileFontawesomeWebfontEOT)
}
func handlerFontsFaSVG(w http.ResponseWriter, r *http.Request) {
w.Header().Set("Content-Type", "application/font-svg")
w.Write(FileFontawesomeWebfontSVG)
}
func handlerFontsFaTTF(w http.ResponseWriter, r *http.Request) {
w.Header().Set("Content-Type", "application/font-ttf")
w.Write(FileFontawesomeWebfontTTF)
}
func handlerFontsFaWOFF(w http.ResponseWriter, r *http.Request) {
w.Header().Set("Content-Type", "application/font-woff")
w.Write(FileFontawesomeWebfontWOFF)
}
func handlerFontsFaWOFF2(w http.ResponseWriter, r *http.Request) {
w.Header().Set("Content-Type", "application/font-woff2")
w.Write(FileFontawesomeWebfontWOFF2)
}
func handlerSiriDBLargePNG(w http.ResponseWriter, r *http.Request) {
w.Header().Set("Content-Type", "image/png")
w.Write(FileSiriDBLargePNG)
}
func handlerSiriDBSmallPNG(w http.ResponseWriter, r *http.Request) {
w.Header().Set("Content-Type", "image/png")
w.Write(FileSiriDBSmallPNG)
}
func handlerLoaderGIF(w http.ResponseWriter, r *http.Request) {
w.Header().Set("Content-Type", "image/gif")
w.Write(FileLoaderGIF)
}