-
Notifications
You must be signed in to change notification settings - Fork 100
Open
Description
We just stumbled across the issue where we needed to create a file dynamically and serve it.
Our usecase:
We need to inject environment variables from the server prefixed by REACT_APP_. I guess the normal case is, that these env vars cannot be known at built time, thus are not baked into the assets. We need to supply them dynamically. We used to handle this using the react-inject-env package, but now we have an environment where the file system is readonly, thus it cannot create the env.js and therefore this approach becomes useless.
It would be nice to have an additional configuration option, e.g.
handler(request, response, {
virtualFiles: [
{ source: 'env.js', content: myPreComputedEnvJs, type: 'application/json' }
]
})which should also integrate nicely with e.g. the headers field.
Metadata
Metadata
Assignees
Labels
No labels