Skip to content

Commit 5602d03

Browse files
committed
Merge samples, support environment name
1 parent ca7806d commit 5602d03

File tree

12 files changed

+19
-202
lines changed

12 files changed

+19
-202
lines changed

samples/SimpleWebAPISample/Program.cs

Lines changed: 0 additions & 50 deletions
This file was deleted.

samples/SimpleWebAPISample/Properties/launchSettings.json

Lines changed: 0 additions & 27 deletions
This file was deleted.

samples/SimpleWebAPISample/README.md

Lines changed: 0 additions & 20 deletions
This file was deleted.

samples/SimpleWebAPISample/SimpleWebAPISample.csproj

Lines changed: 0 additions & 25 deletions
This file was deleted.

samples/SimpleWebAPISample/Startup.cs

Lines changed: 0 additions & 40 deletions
This file was deleted.

samples/SimpleWebAPISample/appsettings.Development.json

Lines changed: 0 additions & 10 deletions
This file was deleted.

samples/SimpleWebAPISample/appsettings.json

Lines changed: 0 additions & 11 deletions
This file was deleted.

samples/SimpleWebAPISample/Controllers/ScopesController.cs renamed to samples/SimpleWebSample/Controllers/ScopesController.cs

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,8 @@
1-
using System;
21
using System.Collections.Generic;
3-
using System.Linq;
4-
using System.Threading.Tasks;
52
using Microsoft.AspNetCore.Mvc;
6-
using Serilog;
73
using Microsoft.Extensions.Logging;
84

9-
namespace SimpleWebAPISample.Controllers
5+
namespace SimpleWebSample.Controllers
106
{
117
[Route("api/[controller]")]
128
public class ScopesController : Controller

samples/SimpleWebAPISample/Controllers/ValuesController.cs renamed to samples/SimpleWebSample/Controllers/ValuesController.cs

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,8 @@
1-
using System;
2-
using System.Collections.Generic;
3-
using System.Linq;
4-
using System.Threading.Tasks;
1+
using System.Collections.Generic;
52
using Microsoft.AspNetCore.Mvc;
63
using Serilog;
74

8-
namespace SimpleWebAPISample.Controllers
5+
namespace SimpleWebSample.Controllers
96
{
107
[Route("api/[controller]")]
118
public class ValuesController : Controller

samples/SimpleWebSample/Program.cs

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@ public static int Main(string[] args)
1313
var configuration = new ConfigurationBuilder()
1414
.SetBasePath(Directory.GetCurrentDirectory())
1515
.AddJsonFile("appsettings.json", optional: false, reloadOnChange: true)
16+
.AddJsonFile($"appsettings.{Environment.GetEnvironmentVariable("ASPNETCORE_ENVIRONMENT")}.json", optional: true)
1617
.Build();
1718

1819
Log.Logger = new LoggerConfiguration()
@@ -25,7 +26,10 @@ public static int Main(string[] args)
2526
{
2627
Log.Information("Getting the motors running...");
2728

28-
var host = WebHost.CreateDefaultBuilder(args)
29+
var host = new WebHostBuilder()
30+
.UseKestrel()
31+
.UseContentRoot(Directory.GetCurrentDirectory())
32+
.UseIISIntegration()
2933
.UseStartup<Startup>()
3034
.UseConfiguration(configuration)
3135
.UseSerilog()

0 commit comments

Comments
 (0)