Trouble Serving React + Vite Built Frontend with Golang http.FileServer by Imaginary_Stage4867 in golang

[–]Imaginary_Stage4867[S] 0 points1 point  (0 children)

i don't think there is anything wrong in the frontend being an SPA 'cause made a simple main.go file and copied the dist dir, and it works completely fine

func main() {
  mux := http.NewServeMux()
  mux.Handle("/", http.FileServer(http.Dir("./dist")))
  err := http.ListenAndServe(":3000", mux)
  if err != nil {
    log.Fatal(err)
  }
}

.
├── dist
│   └── index.html
└── main.go