Created
March 11, 2021 08:35
-
-
Save abierhaus/59eb35135c840c8c583dc5fb16eea719 to your computer and use it in GitHub Desktop.
Use Secrets
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| public void Configure(IApplicationBuilder app, IWebHostEnvironment env) | |
| { | |
| if (env.IsDevelopment()) app.UseDeveloperExceptionPage(); | |
| app.UseRouting(); | |
| //Get User Secrets here | |
| var username = Configuration["YourService:Username"]; | |
| var password = Configuration["YourService:Password"]; | |
| app.UseEndpoints(endpoints => | |
| { | |
| endpoints.MapGet("/", | |
| async context => | |
| { | |
| await context.Response.WriteAsync( | |
| $"Hello. Your successful setup your user secrets. Your username is '{username}'"); | |
| }); | |
| }); | |
| } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment