From 4e52c07107569de291b95171f4947efe8adaa33e Mon Sep 17 00:00:00 2001 From: Noah Spannbauer Date: Sat, 1 Feb 2025 10:56:21 -0600 Subject: [PATCH] refactoring --- app/src/components/logbook/Logbook.tsx | 2 +- app/src/components/siteNav/SiteNav.tsx | 2 ++ infrastructure/main.tf | 39 ++------------------------ 3 files changed, 5 insertions(+), 38 deletions(-) diff --git a/app/src/components/logbook/Logbook.tsx b/app/src/components/logbook/Logbook.tsx index f76ab5d..222fea5 100644 --- a/app/src/components/logbook/Logbook.tsx +++ b/app/src/components/logbook/Logbook.tsx @@ -36,7 +36,7 @@ const Logbook: React.FC = () => { ? { headers: { Authorization: `${token}` } } : {}; const response: AxiosResponse = await httpClient.get(`api/logs`, config); - + console.log(response) dispatch({ type: 'SET_ENTRIES', payload: response.data }); } catch (error) { const axiosError = error as AxiosError; diff --git a/app/src/components/siteNav/SiteNav.tsx b/app/src/components/siteNav/SiteNav.tsx index 448db82..d6f51c7 100644 --- a/app/src/components/siteNav/SiteNav.tsx +++ b/app/src/components/siteNav/SiteNav.tsx @@ -52,6 +52,7 @@ const SiteNav: React.FC = () => { instance.logoutRedirect(); }; const getUserProfile = async (accessToken: string): Promise => { + console.log(accessToken) try { const response: AxiosResponse = await httpClient.get(`api/userProfile`, { headers: { @@ -66,6 +67,7 @@ const SiteNav: React.FC = () => { } }; const getUserPhoto = async (accessToken: string): Promise => { + console.log(accessToken) try { const response: AxiosResponse = await httpClient.get(`api/userPhoto`, { headers: { diff --git a/infrastructure/main.tf b/infrastructure/main.tf index 50c5df1..6c5ad6b 100644 --- a/infrastructure/main.tf +++ b/infrastructure/main.tf @@ -28,11 +28,6 @@ resource "azurerm_container_app" "container_app_api" { password_secret_name = "docker-io-password" } - dapr { - app_id = module.environment.container_app_api_dapr_app_id - app_port = 3000 - } - template { min_replicas = 0 max_replicas = 2 @@ -68,7 +63,7 @@ resource "azurerm_container_app" "container_app_api" { ingress { allow_insecure_connections = false external_enabled = true - target_port = 9090 + target_port = 3000 transport = "auto" traffic_weight { @@ -84,7 +79,7 @@ resource "azurerm_container_app" "container_app_api" { secret { name = "azure-storage-connection-string" - value = var.AZURE_STORAGE_CONNECTION_STRING + value = azurerm_storage_account.storage_account.primary_connection_string } secret { @@ -128,26 +123,6 @@ resource "azurerm_container_app" "container_app_app" { image = module.environment.container_app_app_container_image cpu = 0.25 memory = "0.5Gi" - - env { - name = "VITE_API_URL" - value = azurerm_container_app.container_app_api.latest_revision_fqdn - } - - env { - name = "VITE_CLIENT_ID" - secret_name = "client-id" - } - - env { - name = "VITE_REDIRECT_URL" - value = module.environment.container_app_app_redirect_url - } - - env { - name = "VITE_TENANT_ID" - secret_name = "tenant-id" - } } } @@ -163,21 +138,11 @@ resource "azurerm_container_app" "container_app_app" { } } - secret { - name = "client-id" - value = var.CLIENT_ID - } - secret { name = "docker-io-password" value = var.DOCKER_IO_PASSWORD } - secret { - name = "tenant-id" - value = var.TENANT_ID - } - lifecycle { ignore_changes = [ template[0].container[0].image ] }