Skip to content

Instantly share code, notes, and snippets.

@CoreProgramm
Created May 2, 2020 16:27
Show Gist options
  • Save CoreProgramm/a921d3695dab90923a2f321e840a06cd to your computer and use it in GitHub Desktop.
Save CoreProgramm/a921d3695dab90923a2f321e840a06cd to your computer and use it in GitHub Desktop.
Environment Variables
// This method gets called by the runtime. Use this method to configure the HTTP request pipeline.
public void Configure(IApplicationBuilder app, IWebHostEnvironment env)
{
// If the environment is Development serve Developer Exception Page
if (env.IsDevelopment())
{
app.UseDeveloperExceptionPage();
}
// else serve User Friendly Error Page with Application Support Contact Info
else if (env.IsStaging() || env.IsProduction())
{
app.UseExceptionHandler("/Error");
}
if (env.IsProduction())
{
// code to be executed in production environment
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment