Skip to content

Instantly share code, notes, and snippets.

@manoj-choudhari-git
Last active April 30, 2021 10:27
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save manoj-choudhari-git/8d9bcc8aa0db1a0ca37b1ddaa375bf19 to your computer and use it in GitHub Desktop.
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
// 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