feat(config): resolve the API base at runtime from config.js

This commit is contained in:
LincPay
2026-08-15 17:01:45 +05:30
parent aa1484c285
commit 39ca34be68
4 changed files with 82 additions and 3 deletions
+7
View File
@@ -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