microsoft / microsoft/aspire

Add possibility to prefix EnvVar Names

Open
#1,898 12 comments 3 reactions 0 assignees View on GitHub
area-app-model
Dominant language
C#
Stars
6.3k
Forks
991
Avg merge
2d 15h
Merged PRs (30d)
196

Description

we are using `Vite` to run our react frontends. adding those with AddNpmApp works well, but the problem is, that the environment variables are not available to the frontend.

as per [Vite Documentation](https://vitejs.dev/guide/env-and-mode.html#env-files) environment variables are only available in vite, if the name begins with `VITE_`.

so I suggest to add a `WithEnvironmentPrefix(string prefix)` method to set the prefix for all the exposed environment variables like service URLs, Otlp endpoints etc.

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.