Hi. I have tried to read through the docs and googled for this but can't find what I'm looking for.
I am calling the content delivery API for my site from a SPA on a different host. The response comes with relative paths / URLs for images.
Is it possible to configure the API in some way to return absolute URLs for media items?
d
Dean Leigh
04/02/2024, 8:44 AM
Could you prefix the url in you SPA?
j
Josef Henryson
04/02/2024, 1:54 PM
Yes that is one solution (the one I use now when developing). But it seems to me this should be configurable in Umbraco since the API most probably would be consumed from another app?
d
Dean Leigh
04/02/2024, 2:31 PM
I wonder if it is better to keep it relative in case the images are moved. For example you may move the images from the local site to a CDN.
Sounded like a really good idea but it didn't work unfortunately 😦 Thanks anyway!
m
mcgern
04/18/2024, 3:23 PM
I had (have) exactly the same issue, and have ended up doing the same thing as you (I think) and have the domain as constant which is used in both the api endpoint and the media endpoint. Bit annoying.