diff --git a/doc/design/apex-domain-netlify.md b/doc/design/apex-domain-netlify.md index 00c87ebf2e..fae5993e82 100644 --- a/doc/design/apex-domain-netlify.md +++ b/doc/design/apex-domain-netlify.md @@ -7,7 +7,7 @@ Currently, the GUI is served at gui.dandiarchive.org, while the apex domain dand We've decided that our UI is stable enough to warrant serving it directly at dandiarchive.org, leaving just the task of serving a JSON file containing deployment information. Netlify seems capable of performing this task, and this document outlines the proposal to do so. ## Serving the Deployment JSON file -Netlify cannot specify a different set of redirects for a different build context, so a custom plugin is required. Netlify does support custom JS plugins that hook into the build process and modify the Netlify configuration, so we can use that to specify a different redirect based on the `VUE_APP_DANDI_API_ROOT` environment variable. This redirect will proxy `dandiarchive.org/server-info` to `api.dandiarchive/api/server-info`, or the appropriate domains for staging. +Netlify cannot specify a different set of redirects for a different build context, so a custom plugin is required. Netlify does support custom JS plugins that hook into the build process and modify the Netlify configuration, so we can use that to specify a different redirect based on the `VITE_APP_DANDI_API_ROOT` environment variable. This redirect will proxy `dandiarchive.org/server-info` to `api.dandiarchive/api/server-info`, or the appropriate domains for staging. ## Backwards Compatibility diff --git a/web/netlify/plugins/server-info-build/index.js b/web/netlify/plugins/server-info-build/index.js index 522f2f8d60..dfb8f48a44 100644 --- a/web/netlify/plugins/server-info-build/index.js +++ b/web/netlify/plugins/server-info-build/index.js @@ -1,9 +1,9 @@ module.exports = { // Use onPostBuild hook so that the dist/ folder exists onPostBuild: ({ netlifyConfig }) => { - let apiUrl = process.env.VUE_APP_DANDI_API_ROOT; + let apiUrl = process.env.VITE_APP_DANDI_API_ROOT; if (apiUrl === undefined) { - throw new Error('API URL not defined. Please define it with the VUE_APP_DANDI_API_ROOT environment variable.'); + throw new Error('API URL not defined. Please define it with the VITE_APP_DANDI_API_ROOT environment variable.'); } // Add redirect to server info