feat(config): resolve the API base at runtime from config.js
This commit is contained in:
@@ -19,6 +19,13 @@ server {
|
||||
add_header Cache-Control "no-cache, no-store, must-revalidate";
|
||||
}
|
||||
|
||||
# Runtime config — never cached. It is how the API base is changed without a
|
||||
# rebuild, and a cached copy would silently pin the old URL for every browser
|
||||
# that has already loaded the app, with no way to tell from the server side.
|
||||
location = /config.js {
|
||||
add_header Cache-Control "no-cache, no-store, must-revalidate";
|
||||
}
|
||||
|
||||
# The API, same-origin. The bundle is built with VITE_UDYAM_API_BASE_URL set
|
||||
# to the relative /api/v1/udyam, so it carries no hostname at all and the
|
||||
# same dist/ serves from any domain. That also puts the API on the UI's own
|
||||
|
||||
Reference in New Issue
Block a user