diff --git a/internal/route/main.go b/internal/route/main.go index b416b3c..9c46f61 100644 --- a/internal/route/main.go +++ b/internal/route/main.go @@ -54,7 +54,7 @@ func RoutesPublic(r *mux.Router, bd *gorm.DB) { relPath, _ := filepath.Rel(uploadDir, path) // Important : remplacer \ par / pour Windows relPath = filepath.ToSlash(relPath) - fileURL := fmt.Sprintf("http://%s:4000/upload/%s", "163.172.68.103", relPath) + fileURL := fmt.Sprintf("http://https://media.canguidev.fr/upload/%s", relPath) fmt.Fprintln(w, fileURL) return nil }) diff --git a/main.go b/main.go index 3289cd7..011678b 100644 --- a/main.go +++ b/main.go @@ -33,8 +33,8 @@ func main() { route.RoutesProtected(protected, bd) //setupPortMappingWithFallback(4000, 4000) // 6.5. Exposer le dossier upload - // fs := http.StripPrefix("/upload/", http.FileServer(http.Dir("/app/upload"))) - // r.PathPrefix("/upload/").Handler(fs) + fs := http.StripPrefix("/upload/", http.FileServer(http.Dir("/app/upload"))) + r.PathPrefix("/upload/").Handler(fs) // 7. Lancer le serveur sur le port 4000 log.Fatal(http.ListenAndServe(":4000", r))