Skip to content

Custom environment variable names through .WithReference() #1142

Answered by davidfowl
ADThomsen asked this question in Q&A
Discussion options

You must be logged in to vote

You would use WithEnvironmnt, not with WithReference.

var weatherapi = builder.AddProject<Projects.AspireWithNode_AspNetCoreApi>("weatherapi");

builder.AddNpmApp("frontend", "../NodeFrontend", "watch")
    .WithEnviroment("VITE_SOMETHING", weatherapi.GetEndpoint("http"))
    .WithReference(cache)
    .WithServiceBinding(scheme: "http");

Replies: 3 comments 7 replies

Comment options

You must be logged in to vote
4 replies
@ADThomsen
Comment options

@rose-alex42
Comment options

@hades200082
Comment options

@davidfowl
Comment options

Answer selected by ADThomsen
Comment options

You must be logged in to vote
1 reply
@davidfowl
Comment options

Comment options

You must be logged in to vote
2 replies
@davidfowl
Comment options

@andrem0
Comment options

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
6 participants