I am using https://github.com/willnorris/imageproxy to fetch and resize images on behalf of users. The default app works but I'd like to integrate this with an existing server and change the path to "/proxy/" since "/" will be used for my main app. I also don't want to have to run this separately since it's literally just a few lines I need. I have:
p := imageproxy.NewProxy(nil, nil)
p.SignatureKey = []byte("secret key")
p.Timeout = 10 * time.Second
router := mux.NewRouter().StrictSlash(true)
router.NewRoute().Name("proxy").Methods("GET").Path("/proxy/").Handler(p)
server := &http.Server{
Addr: "127.0.0.1:8000",
Handler: router,
}
I receive "404 page not found" for every image. Changing it to:
server := &http.Server{
Addr: "localhost:8000",
Handler: p,
}
log.Fatal(server.ListenAndServe())
works. Is it possible to do change the path?