trim /public from http
This commit is contained in:
@@ -6,6 +6,7 @@ import (
|
||||
"flag"
|
||||
"fmt"
|
||||
"io"
|
||||
"io/fs"
|
||||
"log"
|
||||
"maps"
|
||||
"net/http"
|
||||
@@ -29,9 +30,13 @@ import (
|
||||
var _staticFileDir embed.FS
|
||||
var publicHandler = func() http.Handler {
|
||||
if os.Getenv("DEBUG") != "" {
|
||||
return http.FileServer(http.Dir("./http"))
|
||||
return http.FileServer(http.Dir("./http/public"))
|
||||
}
|
||||
return http.FileServer(http.FS(_staticFileDir))
|
||||
sub, err := fs.Sub(_staticFileDir, "public")
|
||||
if err != nil {
|
||||
panic(err)
|
||||
}
|
||||
return http.FileServer(http.FS(sub))
|
||||
}()
|
||||
|
||||
func Main() {
|
||||
|
||||
Reference in New Issue
Block a user