I read several posts in this forum about how to configure the url from images stored in Wix but i am not really sure which answer the correct one is for my needs.
Are there specific functions i need to insert into the backend to make the images more accessible for the app? Is there something i have to adjust in the httpfuntions.js file?
I am exposing several databases in my http-functions.js file so is it possible to configure the url for all images exposed through this file?
That is how my http-functions.js file looks like.
import { ok , serverError } from ‘wix-http-functions’ ;
import wixData from ‘wix-data’ ;
I think the question is not clear enough.
Please describe what exactly you wish to achieve. Is the code you posted work for you? Are you storing the images in the collection as full urls or internal Wix URIs? What should be the json structure you wish to send etc…
Hey J.D.,
thanks for the reply! Yes the http-function itself works perfectly fine; i can display Strings created from the JSON data for example. The images in my database are saved as internal WIX URIs.
My current workaround is that i copy the full urls from the image description of each picture in the database as well and use them for displaying images (here in the Main Image App column). And it works right now.
I was just wondering if it possible to replace the first part of the WIX URI ( wix:image://v1 )
with https://static.wixstatic.com/media/ at some point, maybe even in the http-functions.js file; so that the information, which is stored under my Main Image column can be used to display the images without an issue.
@jonatandor35 Where exactly can i put that line from your first answer to work properly? Does it have to be inside the functions like “get_regions()” or do i need a seperate function for that?
And i assume there variables i need to adjust? I am not really a coder; thats why i need to ask.
@acteevent Maybe the field key in your collection is not image but something else (the replace it to the right key in the code).
Anyway open the site monitoring tool and look for error messages.
@jonatandor35 Thank you, that was the error i was making!
For everyone else; this is the working code snippet to change the internal WIX uri to the URL fetchable for apps and other places in the net and make images accessable. It is in the http-functions.js file: