up
This commit is contained in:
parent
f714eac638
commit
f7818e3f86
@ -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
|
||||
})
|
||||
|
||||
4
main.go
4
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))
|
||||
|
||||
Loading…
Reference in New Issue
Block a user