|
@ -18,7 +18,7 @@ func ImageShow(w http.ResponseWriter, r *http.Request) { |
|
|
vars := mux.Vars(r) |
|
|
vars := mux.Vars(r) |
|
|
imageName := vars["imageName"] |
|
|
imageName := vars["imageName"] |
|
|
|
|
|
|
|
|
file, err := ioutil.ReadFile(imageName) |
|
|
|
|
|
|
|
|
file, err := ioutil.ReadFile(config.Folder + "/" + imageName) |
|
|
if err != nil { |
|
|
if err != nil { |
|
|
fmt.Fprintln(w, err) |
|
|
fmt.Fprintln(w, err) |
|
|
} |
|
|
} |
|
@ -63,5 +63,5 @@ func NewImage(w http.ResponseWriter, r *http.Request) { |
|
|
fmt.Println(err) |
|
|
fmt.Println(err) |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
fmt.Fprintln(w, "url:", fileName) |
|
|
|
|
|
|
|
|
fmt.Fprintln(w, config.ServerIP+":"+config.ServerPort+"/images/"+fileName) |
|
|
} |
|
|
} |