How do I serve CSS and JS in Go
http.Handle(“https://stackoverflow.com/”, http.FileServer(http.Dir(“css/”))) Would serve your css directory at /. Of course you can serve whichever directory at whatever path you choose. You probably want to make sure that the static path isn’t in the way of other paths and use something like this. http.Handle(“/static/”, http.StripPrefix(“/static/”, http.FileServer(http.Dir(“static”)))) Placing both your js and css in the directory … Read more