Save image working along with image upload

This commit is contained in:
Steve White 2024-10-11 17:10:32 -05:00
parent 07a7b16f9a
commit b426f59be7
3 changed files with 3 additions and 3 deletions

View File

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

View File

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

View File

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