Hi I am trying to create a server in Go Lang which serves files and HTTP Requests at the same time.
I want /upload
path to accept post requests and
/files
path to serve static files in the fpath
I tried with the following code but i get a 404 error
func main() {
fpath, _ := filepath.Abs(filepath.Dir(os.Args[0]))
fpath+="/public"
fmt.Println(fpath)
http.HandleFunc("/upload",uploadFunc)
http.HandleFunc("/files",http.FileServer(http.Dir(fpath)))
panic(http.ListenAndServe(":8080", nil))
}