-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
f4934ba
commit 4212b1b
Showing
13 changed files
with
108 additions
and
210 deletions.
There are no files selected for viewing
File renamed without changes.
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
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
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
This file was deleted.
Oops, something went wrong.
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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,56 @@ | ||
using Elfo.Wardein.APIs; | ||
using Microsoft.AspNetCore.Hosting; | ||
using System; | ||
using System.Collections.Generic; | ||
using System.Text; | ||
using Microsoft.Extensions.DependencyInjection; | ||
using System.Threading.Tasks; | ||
using Warden; | ||
using Warden.Core; | ||
using Microsoft.Extensions.Configuration; | ||
using Elfo.Wardein.Integrations; | ||
using Elfo.Wardein.Watchers.FileSystem; | ||
using Elfo.Wardein.Watchers.WindowsService; | ||
using Elfo.Wardein.Watchers.IISPool; | ||
|
||
namespace Elfo.Wardein.Services | ||
{ | ||
public class ServiceBuilder | ||
{ | ||
static IWarden warden; | ||
|
||
public async Task ConfigureAndRunWarden() | ||
{ | ||
var appConfiguration = new ConfigurationBuilder() | ||
.AddJsonFile("appsettings.json", optional: true, reloadOnChange: true) | ||
.Build(); | ||
|
||
var connectionString = appConfiguration["ConnectionStrings:Db"]; | ||
|
||
var configuration = WardenConfiguration | ||
.Create() | ||
.IntegrateWithOracle(connectionString) | ||
.AddFileSystemWatcher(null) | ||
.AddWindowsServiceWatcher(null) | ||
.AddIISPoolWatcher(null) | ||
.Build(); | ||
|
||
warden = WardenInstance.Create(configuration); | ||
await warden.StartAsync(); | ||
} | ||
|
||
public async Task ConfigureAndRunAPIHosting() | ||
{ | ||
await new WebHostBuilder() | ||
.UseUrls("http://*:5000") | ||
.UseKestrel() | ||
.ConfigureServices(serviceCollection => | ||
{ | ||
serviceCollection.AddSingleton<IWarden>(warden); | ||
}) | ||
.UseStartup<Startup>() | ||
.Build() | ||
.RunAsync(); | ||
} | ||
} | ||
} |
This file was deleted.
Oops, something went wrong.
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
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
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
Oops, something went wrong.