Setheroni
Setheroni

Reputation: 145

Serve HTML with gorilla mux

I have a golang app that needs a homepage. I'm struggling to get it to serve a simple html file. I'm able to do it locally like this:

router.PathPrefix("/").Handler(http.FileServer(http.Dir("./views/")))

This works for me on Windows and Pop OS, however, when I deploy this to my ubuntu server on AWS, it says 404 not found.

Upvotes: 0

Views: 249

Answers (1)

S.Cavid
S.Cavid

Reputation: 26

On ubuntu use full adress like http.dir(/root/workpath/yourgofolder/projectfolder/

Upvotes: 1

Related Questions