Created
February 19, 2017 23:58
-
-
Save renatogroffe/2c510458257e61a78b08c4fb6febd446 to your computer and use it in GitHub Desktop.
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
| using Microsoft.AspNetCore.Builder; | |
| using Microsoft.AspNetCore.Hosting; | |
| using Microsoft.Extensions.Configuration; | |
| using Microsoft.Extensions.DependencyInjection; | |
| using Microsoft.Extensions.Logging; | |
| namespace APICotacoesNoSQL | |
| { | |
| public class Startup | |
| { | |
| public Startup(IHostingEnvironment env) | |
| { | |
| var builder = new ConfigurationBuilder() | |
| .SetBasePath(env.ContentRootPath) | |
| .AddJsonFile("appsettings.json", optional: true, reloadOnChange: true) | |
| .AddJsonFile($"appsettings.{env.EnvironmentName}.json", optional: true) | |
| .AddEnvironmentVariables(); | |
| Configuration = builder.Build(); | |
| } | |
| public IConfigurationRoot Configuration { get; } | |
| public void ConfigureServices(IServiceCollection services) | |
| { | |
| services.AddSingleton<IConfiguration>(Configuration); | |
| services.AddMvc(); | |
| } | |
| public void Configure( | |
| IApplicationBuilder app, | |
| IHostingEnvironment env, | |
| ILoggerFactory loggerFactory) | |
| { | |
| loggerFactory.AddConsole(Configuration.GetSection("Logging")); | |
| loggerFactory.AddDebug(); | |
| app.UseMvc(); | |
| } | |
| } | |
| } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment