Example code to create a REST API to upload images from my desktop into a collection?

Can you point me to example server side code to create a http post function in the http-functions.js file which can upload an image and write it to a wix collection. I have read the documentation for the media manager uplaod() and importFile() functions. However i am not sure how to use them to create a POST call end point.

In the past i have tried using npm modules to create an function which handles post requests containing multiplart form data. However wix does not seem to like node modules like formidable and keeps giving me errors.

See the article Velo: Exposing a Site API with HTTP Functions on information on creating an API for your site.

The following examples demonstrate exposing an API on a site:

@yisrael-wix i was able to follow the example code provided on Velo: Exposing a Site API with HTTP Functions and set up a function that handles post requests for image upload. As per the example it expects the image url as a key value pair in json format and then goes onto insert that image url into a wix collection. I have this working perfectly but when i look in my collection the image is not present and looks like the below screenshot.

I am trying to upload an image from my computer. I have tried google drive images as well

Here is my code

export function post_testData(request) {
 
 return request.body.json()
 .then(body => {
 let recordInsert = {
 title : body.Title,
 titleDescription : body.TitleDescription,
 longDescription : body.LongDescription,
 shortBulletPoints : body.ShortDescription,
 metroplexLocation : body.MetroPlexLocation,
 youtubeVideo : body.YoutubeVideoLink,
 image1 :body.imageurl,
 displayPicture: body.imageurla
 };

 return wixData.insert("testCollection", recordInsert)
 
 .then (result => ok({body : JSON.stringify(result)}))
 .catch ( err => response ({status : 500 , body :err}));
 })
}

Not sure why this has been marked solved. The link Velo: Exposing a Site API with HTTP Functions doesnt show the upload code anymore.

I have even tried using the wix-media manager’s getuploadurl() function to try and upload a file as described. However the example code returns with errors stating the json is in an invalid format

@yisrael-wix any help is appreciated