Last active
April 30, 2021 10:27
-
-
Save manoj-choudhari-git/8d9bcc8aa0db1a0ca37b1ddaa375bf19 to your computer and use it in GitHub Desktop.
Snippet from Startup.cs to demonstrate how IWebHostEnvironment can be used to identify the environment
This file contains 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
// IWebHostEnvironment extends IHostEnvironment | |
public void Configure(IApplicationBuilder app, IWebHostEnvironment env) | |
{ | |
if (env.IsDevelopment()) | |
{ | |
app.UseDeveloperExceptionPage(); | |
} | |
else | |
{ | |
app.UseExceptionHandler("/Home/Error"); | |
// The default HSTS value is 30 days. | |
// You may want to change this for production scenarios, | |
// see https://aka.ms/aspnetcore-hsts. | |
app.UseHsts(); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment