-
Notifications
You must be signed in to change notification settings - Fork 15
Description
I have a lot of links like /api/content/[content_id].[content_type] (images and pdfs in my case) which fetch binary files from the API. Currently this content is served dynamically along with generated static app. I want to automatically download it and save to, say, /static folder during the generation process.
Do I have to write a function for that which manually replicates the file structure in order to do that and then run it at some of the build hooks (and then proxying /api/content URLs into /static when serving), or is there at least a theoretical way to retrieve all these links during generation and make Node follow them, download and store the files mimicking the original url while rewriting the links in the process?
If what I want is theoretically possible, but cannot be implemented right now with some configuration, I might consider digging into this and possibly making a PR at some point in case the idea makes sense.