-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathmain.go
38 lines (27 loc) · 965 Bytes
/
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
package main
import (
"expvar"
"log"
"net/http"
)
func main() {
mux := http.NewServeMux()
mux.HandleFunc("/git_repo", GitRepo)
mux.HandleFunc("/force_gc", ForceGC)
mux.HandleFunc("/set_memlimit", SetMemoryLimit)
mux.HandleFunc("/set_gogc", SetGCPercent)
mux.HandleFunc("/free_memory", DebugFreeOSMemory)
mux.HandleFunc("/print_all_metrics", printAllMetrics)
mux.HandleFunc("/print_some_metrics", printSomeMetrics)
mux.Handle("/debug/vars", expvar.Handler())
mux.HandleFunc("/dist/assets/index-CbqqRaG6.js", func(w http.ResponseWriter, r *http.Request) {
http.ServeFile(w, r, "./dist/assets/index-CbqqRaG6.js")
})
mux.HandleFunc("/dist/assets/index-CsnRi_qw.css", func(w http.ResponseWriter, r *http.Request) {
http.ServeFile(w, r, "./dist/assets/index-CsnRi_qw.css")
})
mux.HandleFunc("/", func(w http.ResponseWriter, r *http.Request) {
http.ServeFile(w, r, "./dist/index.html")
})
log.Fatal(http.ListenAndServe(":8000", mux))
}