Please forgive me if this has been covered. I took some time to search through existing posts but I could not find a solution that worked for me. I am new to Netlify and spent quite some time figuring it out. The code works when I run it locally using ‘ntl dev’ in my terminal. It pulls the images from Unsplash and are styled correctly. But when Netlify builds it, the site stops working.
I receive the following error when inspecting the Netlify website.
(This is only letting me upload 1 picture so I will try to add more to comments)
In local development it works and logs a status code of 200 and then logs my photosArray.
It tells me the fetch doesn’t work and server responds with a status of 502
My Netlify Serverless function (picture in comments)
Please let me know if any more information or screenshots from me are needed.
Please help!! Thanks!!