-
I used the AspireWithNode example to have my react app in my Aspire solution, and it works. Now I would like to customize the name of the environment variable holding the URI of my I have found the code that generates the environment variable in |
Beta Was this translation helpful? Give feedback.
Replies: 3 comments 9 replies
-
You would use var weatherapi = builder.AddProject<Projects.AspireWithNode_AspNetCoreApi>("weatherapi");
builder.AddNpmApp("frontend", "../NodeFrontend", "watch")
.WithEnviroment("VITE_SOMETHING", weatherapi.GetEndpoint("http"))
.WithReference(cache)
.WithServiceBinding(scheme: "http"); |
Beta Was this translation helpful? Give feedback.
-
Hi @davidfowl, What if I want to set an environment variable to a more complex URI that contains the endpoint? If |
Beta Was this translation helpful? Give feedback.
-
@davidfowl I'm trying to do a similar thing using Yarn, but the variables are not available to read inside my application code. Any clue why?
|
Beta Was this translation helpful? Give feedback.
You would use
WithEnvironmnt
, not with WithReference.