Is there a way to access react project files in lambda?

Hello community!

Currently, when a project is built, I download a few zip files from Contentful and unzip them and write the code from the JSONs in them into a project directory. This is done in gatsby-node.js. They unzip to directory src/user/styles with an index file importing and exporting them all. This works wonderfully and allows my client to just upload zip files instead of doing more work.

I want to use netlify lambda functions to send a post request using secret API keys. This works very well, but I would also like to send some contents of these zip files as post data. I could of course send ALL the data from the react state, but I would rather just send the ID as a post request and use netlify lambda to access my public directory. Is this even possible?

So basically, I need to access the built gatsby project from netlify lambda and see if there is a consistant way to access these unzipped files. Or perhaps I can add another path for these files to unzipped to in gatsby-node.

What do you think?

Hi @CodeAmend, you could get the files of site via the API. There’s an endpoint for the list of all files deployed on your site and another to get a specific file. Would that work for you?