Save image working along with image upload
This commit is contained in:
parent
07a7b16f9a
commit
b426f59be7
|
@ -1,6 +1,6 @@
|
|||
database_path: "data/boxes.db"
|
||||
test_database_path: "data/test_database.db"
|
||||
jwt_secret: "super_secret_key"
|
||||
image_storage_dir: "./images/"
|
||||
image_storage_dir: "images"
|
||||
listening_port: 8080
|
||||
log_file: "boxes.log"
|
|
@ -217,7 +217,7 @@ func UploadItemImageHandler(w http.ResponseWriter, r *http.Request) {
|
|||
http.Error(w, "Unable to save image path in database", http.StatusInternalServerError)
|
||||
return
|
||||
}
|
||||
|
||||
fmt.Println("Image upload called")
|
||||
// Return the image path in the response
|
||||
w.WriteHeader(http.StatusOK)
|
||||
json.NewEncoder(w).Encode(map[string]string{"imagePath": filePath})
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
#!/bin/bash
|
||||
|
||||
# API base URL
|
||||
API_BASE_URL="http://10.0.0.66:8080"
|
||||
API_BASE_URL="http://10.0.0.16:8080"
|
||||
|
||||
# Login credentials
|
||||
USERNAME="boxuser"
|
||||
|
|
Loading…
Reference in New Issue