This commit is contained in:
@@ -1,6 +1,8 @@
|
|||||||
# Vegasco Server
|
# 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
|
## 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.
|
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.
|
||||||
|
|||||||
@@ -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.
|
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
|
## Code scaffolding
|
||||||
|
|
||||||
Angular CLI includes powerful code scaffolding tools. To generate a new component, run:
|
Angular CLI includes powerful code scaffolding tools. To generate a new component, run:
|
||||||
|
|||||||
Reference in New Issue
Block a user