From 4c00f868c7f8f36f68a703cbf390a9e69c1b6868 Mon Sep 17 00:00:00 2001 From: ThompsonNye Date: Fri, 20 Jun 2025 21:44:05 +0200 Subject: [PATCH] Update READMEs --- README.md | 6 ++++-- src/Vegasco-Web/README.md | 10 ++++++++++ 2 files changed, 14 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index 54c564d..13a6fa5 100644 --- a/README.md +++ b/README.md @@ -1,6 +1,8 @@ # Vegasco Server -Backend for the vegasco (**VE**hicle **GAS** **CO**nsumption) application. +Vegasco (**VE**hicle **GAS** **CO**nsumption) application. + +Includes the backend (`src/Vegasco.Server.Api`) and the frontend (`src/Vegasco-Web`). Utilizes [Aspire](https://learn.microsoft.com/en-us/dotnet/aspire/get-started/aspire-overview). ## Getting Started @@ -64,4 +66,4 @@ creates a Postgres database as a docker container, and starts the Api with the c Ensure you have an identity provider set up, for example Keycloak, and configured the relevant options described above. -Then, to run the application, ensure you have Docker running, then run the `Vegasco.Server.AppHost` launch profile. +Then, to run the application, ensure you have Docker running, then run either the `http` or `https` launch profile of the `Vegasco.Server.AppHost` project. diff --git a/src/Vegasco-Web/README.md b/src/Vegasco-Web/README.md index f4a28cc..412e7db 100644 --- a/src/Vegasco-Web/README.md +++ b/src/Vegasco-Web/README.md @@ -12,6 +12,16 @@ ng serve Once the server is running, open your browser and navigate to `http://localhost:4200/`. The application will automatically reload whenever you modify any of the source files. +## API Proxy + +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. + +To allow the dev proxy to accept otherwise untrusted server certificates, set `NODE_ENV` to `development`. Otherwise the dev proxy rejects untrusted certificates. + +When deploying the application elsewhere, another proxy has to be configured to provide the same functionality to ensure the application works correctly. + ## Code scaffolding Angular CLI includes powerful code scaffolding tools. To generate a new component, run: