Commented out some bs
This commit is contained in:
parent
36ce2e9de8
commit
9a70d1130d
22
main.go
22
main.go
|
@ -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!")
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue