Skip to content

Commit

Permalink
feat(search): allow to use different backend (#155)
Browse files Browse the repository at this point in the history
  • Loading branch information
sinedied authored Dec 4, 2023
1 parent 703eae8 commit b1320de
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 1 deletion.
4 changes: 4 additions & 0 deletions infra/main.bicep
Original file line number Diff line number Diff line change
Expand Up @@ -78,6 +78,9 @@ param useApplicationInsights bool = false

param allowedOrigin string

// Allow to override the default backend
param backendUri string = ''

// Only needed for CD due to internal policies restrictions
param aliasTag string = ''
// Differentiates between automated and manual deployments
Expand Down Expand Up @@ -536,3 +539,4 @@ output SEARCH_API_URI string = searchApi.outputs.uri
output INDEXER_API_URI string = indexerApi.outputs.uri

output ALLOWED_ORIGINS string = join(allowedOrigins, ',')
output BACKEND_URI string = !empty(backendUri) ? backendUri : searchApi.outputs.uri
3 changes: 3 additions & 0 deletions infra/main.parameters.json
Original file line number Diff line number Diff line change
Expand Up @@ -77,6 +77,9 @@
"allowedOrigin": {
"value": "${ALLOWED_ORIGIN=''}"
},
"backendUri": {
"value": "${BACKEND_URI}"
},
"aliasTag": {
"value": "${AZURE_ALIAS}"
},
Expand Down
2 changes: 1 addition & 1 deletion packages/webapp/vite.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ import { defineConfig } from 'vite';
import react from '@vitejs/plugin-react';

// Expose environment variables to the client
process.env.VITE_SEARCH_API_URI = process.env.SEARCH_API_URI ?? '';
process.env.VITE_SEARCH_API_URI = process.env.BACKEND_URI ?? '';
console.log(`Using search API base URL: "${process.env.VITE_SEARCH_API_URI}"`);

// https://vitejs.dev/config/
Expand Down

0 comments on commit b1320de

Please sign in to comment.