From 4b377ce9f4bbb5cfab4c34dc097c119cf77b59a1 Mon Sep 17 00:00:00 2001 From: ThompsonNye Date: Tue, 24 Jun 2025 20:35:26 +0200 Subject: [PATCH] Fix resource name to be a valid Aspire resource name --- src/Vegasco-Web/.vscode/tasks.json | 2 +- src/Vegasco-Web/README.md | 2 +- src/Vegasco-Web/proxy.config.js | 4 ++-- src/Vegasco-Web/webserver.conf.template | 2 +- src/Vegasco.Server.AppHost.Shared/Constants.cs | 2 +- 5 files changed, 6 insertions(+), 6 deletions(-) diff --git a/src/Vegasco-Web/.vscode/tasks.json b/src/Vegasco-Web/.vscode/tasks.json index 84052b9..5fe42c3 100644 --- a/src/Vegasco-Web/.vscode/tasks.json +++ b/src/Vegasco-Web/.vscode/tasks.json @@ -14,7 +14,7 @@ "options": { "env": { "PORT": "44200", - "services__Vegasco-Server-Api__https__0": "https://localhost:7098", + "services__Api__https__0": "https://localhost:7098", "NODE_ENV": "development" } }, diff --git a/src/Vegasco-Web/README.md b/src/Vegasco-Web/README.md index 412e7db..dcb34ef 100644 --- a/src/Vegasco-Web/README.md +++ b/src/Vegasco-Web/README.md @@ -16,7 +16,7 @@ Once the server is running, open your browser and navigate to `http://localhost: Because the solution utilizes Aspire which injects endpoint references for the API as environment variables, this application uses a proxy to access the API. The proxy is configured in the `proxy.config.js` file which is used in the `serve` section of the `angular.json` file. This makes the dev server provide a proxy when serving the application. -The environment variables for the API endpoint are named `services__Vegasco-Server-Api__https__0` and `services__Vegasco-Server-Api__http__0` for the https and the http endpoints respectively. If the https endpoint is not configured, the http endpoint is used. At least one of them has to be configured. +The environment variables for the API endpoint are named `services__Api__https__0` and `services__Api__http__0` for the https and the http endpoints respectively. If the https endpoint is not configured, the http endpoint is used. At least one of them has to be configured. To allow the dev proxy to accept otherwise untrusted server certificates, set `NODE_ENV` to `development`. Otherwise the dev proxy rejects untrusted certificates. diff --git a/src/Vegasco-Web/proxy.config.js b/src/Vegasco-Web/proxy.config.js index dc3fb38..086e764 100644 --- a/src/Vegasco-Web/proxy.config.js +++ b/src/Vegasco-Web/proxy.config.js @@ -1,8 +1,8 @@ module.exports = { "/api": { target: - process.env["services__Vegasco-Server-Api__https__0"] || - process.env["services__Vegasco-Server-Api__http__0"], + process.env["services__Api__https__0"] || + process.env["services__Api__http__0"], secure: process.env["NODE_ENV"] !== "development", pathRewrite: { "^/api": "", diff --git a/src/Vegasco-Web/webserver.conf.template b/src/Vegasco-Web/webserver.conf.template index b4c7d35..095c2c1 100644 --- a/src/Vegasco-Web/webserver.conf.template +++ b/src/Vegasco-Web/webserver.conf.template @@ -2,7 +2,7 @@ server { listen 80; location ~ ^/api/(.*) { - proxy_pass ${services__Vegasco_Server_Api__https__0}/$1; + proxy_pass ${services__Api__https__0}/$1; } location / { diff --git a/src/Vegasco.Server.AppHost.Shared/Constants.cs b/src/Vegasco.Server.AppHost.Shared/Constants.cs index 9c1dc4c..4b18f9b 100644 --- a/src/Vegasco.Server.AppHost.Shared/Constants.cs +++ b/src/Vegasco.Server.AppHost.Shared/Constants.cs @@ -4,7 +4,7 @@ public static class Constants { public static class Projects { - public const string Api = "Vegasco_Server_Api"; + public const string Api = "Api"; } public static class Database