Commented out some bs

This commit is contained in:
Steve White 2024-10-23 21:49:03 -05:00
parent 36ce2e9de8
commit 9a70d1130d
1 changed files with 11 additions and 11 deletions

22
main.go
View File

@ -62,20 +62,20 @@ func main() {
}
defer db.Close()
customHandler := http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) {
// Don't handle /static/ paths here - let the static file server handle those
if strings.HasPrefix(r.URL.Path, "/static/") {
http.NotFound(w, r)
return
}
// customHandler := http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) {
// // Don't handle /static/ paths here - let the static file server handle those
// if strings.HasPrefix(r.URL.Path, "/static/") {
// http.NotFound(w, r)
// return
// }
// For all other routes, serve index.html
indexPath := filepath.Join(staticPath, "index.html")
http.ServeFile(w, r, indexPath)
})
// // For all other routes, serve index.html
// indexPath := filepath.Join(staticPath, "index.html")
// http.ServeFile(w, r, indexPath)
// })
// Register the catch-all handler for non-static routes
staticRouter.PathPrefix("/").Handler(customHandler)
//staticRouter.PathPrefix("/").Handler(customHandler)
fmt.Println("Default user 'boxuser' created successfully!")