Finished subpath implementation
This commit is contained in:
@@ -5,10 +5,11 @@ import (
|
||||
"net/http"
|
||||
"os"
|
||||
"path/filepath"
|
||||
"strings"
|
||||
)
|
||||
|
||||
func ServePath(w http.ResponseWriter, r *http.Request) {
|
||||
path := filepath.Join(config.FrontendDir, r.URL.Path)
|
||||
path := filepath.Join(config.FrontendDir, strings.TrimPrefix(r.URL.Path, config.Prefix))
|
||||
if _, err := os.Stat(path); os.IsNotExist(err) {
|
||||
Error404(w, r)
|
||||
} else {
|
||||
|
||||
Reference in New Issue
Block a user