In my html I'm trying to include JS using
<script src="/js/app.js"></script>
I have also tried relative path (from server location)
<script src="js/app.js"></script>
and relative from the html file
My file structure
-js
app.js
-templates
index.html
hub.go
main.go
main.go is the server
func main() {
http.HandleFunc("/", rootHandler)
http.ListenAndServe(":8080", nil)
}
func rootHandler(w http.ResponseWriter, r *http.Request) {
http.ServeFile(w, r, "Templates/index.html")
}
Am I missing something do I have to server css/js through server? or should the simple html work