Hosting a file along with my function

Since the ‘publish’ is essentially your site, you could use the env var URL (as mentioned here) to address the file on your deployed site. Note that your lambda function does not live in the same ‘machine’ as your netlify site, so you can’t access any files from your publish directory directly through some filesystem method.

Hope that answers your question.

1 Like