This commit is contained in:
julien 2025-06-18 16:29:23 +02:00
parent f714eac638
commit f7818e3f86
2 changed files with 3 additions and 3 deletions

View File

@ -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
})

View File

@ -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))