Answers for "serve html files golang with other routes"

CSS
1

how to serve css in golang

// if you keep all css and js in a static folder
// you can use this

func main() {
  http.Handle("/static/", http.StripPrefix("/static/", http.FileServer(http.Dir("static"))))
}
Posted by: Guest on October-26-2020

Code answers related to "serve html files golang with other routes"

Browse Popular Code Answers by Language