Move to git.themmonk.com
This commit is contained in:
18
internal/httpserver/webui.go
Normal file
18
internal/httpserver/webui.go
Normal file
@@ -0,0 +1,18 @@
|
||||
package httpserver
|
||||
|
||||
import (
|
||||
"net/http"
|
||||
)
|
||||
|
||||
func RegisterWebui() {
|
||||
http.HandleFunc("/", func(w http.ResponseWriter, r *http.Request) {
|
||||
if r.URL.Path == "/" {
|
||||
http.Redirect(w, r, "/web/", http.StatusPermanentRedirect)
|
||||
return
|
||||
}
|
||||
http.NotFound(w, r)
|
||||
})
|
||||
|
||||
fs := http.FileServer(http.Dir("web"))
|
||||
http.Handle("/web/", http.StripPrefix("/web/", fs))
|
||||
}
|
||||
Reference in New Issue
Block a user