Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Application environment configurations support #28

Open
zdrawku opened this issue Nov 13, 2023 · 0 comments
Open

Application environment configurations support #28

zdrawku opened this issue Nov 13, 2023 · 0 comments

Comments

@zdrawku
Copy link
Contributor

zdrawku commented Nov 13, 2023

Current state:
At the moment, if the OpenAPI schema file has defined servers (environments) App Builder will list them as dropdown options to pick from. Upon app code generation the selected Base URL will be hardcoded in the application files instead of exposing it in a config file/s (example with Blazor below). This leads to problems when there is a need to work on different deploy/build environments.
image

Expected result:
AppBuilder should automatically generate an appsettings.json, appsettings.development.json, or whatever is defined for each environment (Blazor-specific example). Any generated application should be ready to plug into a build and release pipeline if needed. In order to achieve that, App Builder should provide a UI to set the environment name, which will be used for the application settings environment files/configurations (based on the Framework).

For Blazor that would be appsettings.{Environment}.json configurations
image

For Angular environment.{env-name}.ts file
image

Based on the framework, other changes should be considered, not only the configuration files, but also:

  • Angular, for example, would be the target-specific files, building and serving configurations, and so on.
  • Blazor, for example is having app settings per environment. This means we need to set the environment variable on the server-side either by setting the ASPNETCORE_ENVIRONMENT environment variable or the blazor-environment response header. For Blazor Wasm, there is a boot script that loads the appsettings.json and appsettings.{Environment}.json file corresponding to the blazer-environment received and populate the WebAssemblyHostBuilder.Configuration with data in those files. We can then configure components, services, or js.

You can then configuration to your components, services or js

Looking at the OpenAPI spec docs, using of variables is something that we can explore to use the typed-in values from the UI:
image

Notes:
A UI for Specifying server (env) names is required as the OpenAPI spec doesn't provide a way to define server name, except the description field and we cannot use a clear pattern on doing this automatically based on provided Data Schema.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant