You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Is your feature request related to a problem? Please describe.
We have single backend for multiple UIs on different domains. The automatic resolution of asset URL doesn't work for us in a way we would like and we need more control over it.
assetUrlPrefix option worked for us when having single domain, but now when we have multiple domains we need to be able to resolve the URL root on the fly - e.g. from req host property.
Describe the solution you'd like
assetUrlPrefix to allow custom function that would have RequestContext as a parameter and return type of string. With such functionality we will be able to serve media files with same domain as UI, or any other dynamically resolved URL prefix.
Describe alternatives you've considered
JS string replace() method on already resolved media url.
Additional context
v1.0-beta.3
The text was updated successfully, but these errors were encountered:
This is a good idea and can be implemented without a breaking change.
assetUrlPrefix to allow custom function that would have RequestContext as a parameter and return type of string
We can definitely pass the Express req object in, and I'll have to check whether it is possible to also supply the RequestContext. The reason is that this function will be executed in the Apollo Server layer, outside the NestJS context. But since the RequestContext is internally stored as a property on the req object it should be possible to fish it out and pass to this function.
Is your feature request related to a problem? Please describe.
We have single backend for multiple UIs on different domains. The automatic resolution of asset URL doesn't work for us in a way we would like and we need more control over it.
assetUrlPrefix option worked for us when having single domain, but now when we have multiple domains we need to be able to resolve the URL root on the fly - e.g. from req host property.
Describe the solution you'd like
assetUrlPrefix to allow custom function that would have RequestContext as a parameter and return type of string. With such functionality we will be able to serve media files with same domain as UI, or any other dynamically resolved URL prefix.
Describe alternatives you've considered
JS string replace() method on already resolved media url.
Additional context
v1.0-beta.3
The text was updated successfully, but these errors were encountered: