I have an astro APP that is working fine. I have a new use case where I need to render the save HTML at different domain and base path. For example currently I am rendering it at astrosite.com now I need to run it under anothersite.com/preview as well. I have done some tests with the astro configs, but they are only taking effect during build time. I am running astro inside a docker image, so if possible I don't want to build two images for staging and production just for this. Is there any workaround I can apply to my use case ? thank you so much for any input
#[Solved] possibility to set AssetsPrefix at runtime for node adapter
8 messages · Page 1 of 1 (latest)
I suppose we are talking about SSR-pages.
Probably https://developer.mozilla.org/en-US/docs/Web/HTML/Element/base can help?
one solution I used is <base /> html tag
@sinful hound exactly that!, we were typing at the same time lol
So just for future readers, setting that in Layout.astro and reading the value from environment variable will work. Each environment has a value for the url of the astro app in it.
@sinful hound thank you for looking into it
Np.. Glad you found a solution.
And to close this up, no way to setup AssetPrefix config, that is a build time confige