I want to remove the last trailing slash in the path, ex: localhost:8080/Login/ --> localhost:8080/Login. In code, I use /login instead of /login/ but css and js don't work, please help!
This is my code:
Go file:
func main() {
fileServer := http.FileServer(http.Dir("pages"))
//http.Handle("/Login/", http.StripPrefix("/Login/", fileServer))
http.Handle("/Login", http.StripPrefix("/Login", fileServer))
http.ListenAndServe(":8080", nil)
}
HTTP file:
<link href="/css/bootstrap/bootstrap-4.3.1.css" rel="stylesheet" />
<script src="/js/bootstrap/bootstrap-4.3.1.js"></script>