I have been trying to figure out how to serve css and html on the same page a few times now but I always just end up getting frustrated and using bootstrap. I really want to have my next project to have my own hand written css though. My source tree looks like this.
- cmd
- main.go
- static
- css
- templates
The reason my source tree looks like this because I want to have two packages in cmd: one for providing mock data the other for running the actual application. I have seen other posts where a http.FileServer is used however the project structure is much different with the main.go file at the root of the directory. I try to do a path something like:
fs := http.FileServer(http.Dir("../static/css"))
http.Handle("/signup/", http.StripPrefix("/static/css", fs))