Compare commits
1
Commits
de05c7215f
..
main
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
64e1d8c0f4 |
+2
-1
@@ -72,7 +72,8 @@ func serve(ctx context.Context) error {
|
|||||||
// dist/web/MoonMiners beside this checkout); without one, / goes to the admin.
|
// dist/web/MoonMiners beside this checkout); without one, / goes to the admin.
|
||||||
webDir := env("MM_WEB_DIR", "../client/dist/web/MoonMiners")
|
webDir := env("MM_WEB_DIR", "../client/dist/web/MoonMiners")
|
||||||
if st, err := os.Stat(webDir + "/index.html"); err == nil && !st.IsDir() {
|
if st, err := os.Stat(webDir + "/index.html"); err == nil && !st.IsDir() {
|
||||||
mux.Handle("GET /", http.FileServerFS(os.DirFS(webDir)))
|
// "/", not "GET /": that would conflict with the method-less /utils patterns (panic)
|
||||||
|
mux.Handle("/", http.FileServerFS(os.DirFS(webDir)))
|
||||||
} else {
|
} else {
|
||||||
mux.HandleFunc("GET /{$}", func(w http.ResponseWriter, r *http.Request) {
|
mux.HandleFunc("GET /{$}", func(w http.ResponseWriter, r *http.Request) {
|
||||||
http.Redirect(w, r, "/utils", http.StatusSeeOther)
|
http.Redirect(w, r, "/utils", http.StatusSeeOther)
|
||||||
|
|||||||
Reference in new issue
Block a user