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