I have a question regarding Netlify’s lambda functions. I am trying to read a JSON file inside a lambda function, which are both in the same directory.
This is somewhat tricky, and has apparently been solved in this thread: How to deploy a directory along with a function? using the boilerplate provided here: https://github.com/mraerino/netlify-functions-readfile
I set up my project in the same way the Github sample is set up, however, when the function is triggered a HTTP 502 error is returned immediately.
The function is working correctly when I use Netlify Dev on my local machine.
This is the URL, that triggers the error: https://esimroaming.info/.netlify/functions/trip-planner/?countries=BT
Did anyone already solve a similar problem to this? Thanks in advance for any advice.
PS: The function log does not show any errors. I am using zip-it-and-ship-it like in the Github project.