File tree Expand file tree Collapse file tree 2 files changed +12
-8
lines changed
Expand file tree Collapse file tree 2 files changed +12
-8
lines changed Original file line number Diff line number Diff line change @@ -35,10 +35,7 @@ resource "azurerm_linux_web_app" "backend" {
3535 go_version = " 1.21"
3636 }
3737 cors {
38- allowed_origins = [
39- " https://${ azurerm_static_site . frontend . default_host_name } "
40- ]
41- support_credentials = true
38+ allowed_origins = [" *" ]
4239 }
4340 }
4441
@@ -54,8 +51,10 @@ resource "azurerm_static_site" "frontend" {
5451 location = var. location
5552 sku_tier = " Free"
5653 sku_size = " Free"
54+ }
5755
58- app_settings = {
59- " REACT_APP_API_URL" = " https://${ azurerm_linux_web_app . backend . default_hostname } "
60- }
56+ resource "azurerm_static_site_custom_domain" "frontend_env" {
57+ static_site_id = azurerm_static_site. frontend . id
58+ domain_name = azurerm_static_site. frontend . default_host_name
59+ validation_type = " cname-delegation"
6160}
Original file line number Diff line number Diff line change @@ -8,6 +8,11 @@ output "backend_url" {
88 description = " Go API URL"
99}
1010
11+ output "backend_api_url_for_react" {
12+ value = " https://${ azurerm_linux_web_app . backend . default_hostname } "
13+ description = " Use this URL in your React app as REACT_APP_API_URL"
14+ }
15+
1116output "static_web_app_name" {
1217 value = azurerm_static_site. frontend . name
1318 description = " For deployment token"
@@ -16,4 +21,4 @@ output "static_web_app_name" {
1621output "app_service_name" {
1722 value = azurerm_linux_web_app. backend . name
1823 description = " For publish profile"
19- }
24+ }
You can’t perform that action at this time.
0 commit comments