Add RequestLogExpirationDuration and MaxRequestLogCount (#43) (#45)

This commit is contained in:
Stef Heyenrath
2017-08-20 11:20:35 +02:00
committed by GitHub
parent 76f0e04874
commit f8ad2cd3d6
19 changed files with 682 additions and 509 deletions

View File

@@ -12,7 +12,7 @@ namespace WireMock.Net.Client
static void Main(string[] args)
{
// Create an implementation of the IFluentMockServerAdmin and pass in the base URL for the API.
var api = RestClient.For<IFluentMockServerAdmin>("http://localhost:9090");
var api = RestClient.For<IFluentMockServerAdmin>("http://localhost:9091");
// Set BASIC Auth
var value = Convert.ToBase64String(Encoding.ASCII.GetBytes("a:b"));

View File

@@ -12,8 +12,7 @@
<ItemGroup>
<ProjectReference Include="..\..\src\WireMock.Net\WireMock.Net.csproj" />
<!--<ProjectReference Include="..\WireMock.Net\WireMock.Net.csproj" />-->
<PackageReference Include="Newtonsoft.Json" Version="9.0.1" />
<PackageReference Include="Newtonsoft.Json" Version="10.0.1" />
</ItemGroup>
</Project>

View File

@@ -13,8 +13,8 @@ namespace WireMock.Net.ConsoleApplication
{
public static void Run()
{
string url1 = "http://localhost:9090/";
string url2 = "http://localhost:9091/";
string url1 = "http://localhost:9091/";
string url2 = "http://localhost:9092/";
string url3 = "https://localhost:9443/";
var server = FluentMockServer.Start(new FluentMockServerSettings

View File

@@ -1,15 +1,42 @@
using System;
using System.Threading;
using WireMock.Server;
namespace WireMock.Net.StandAlone.NETCoreApp
{
class Program
{
private static int sleepTime = 30000;
private static FluentMockServer server;
static void Main(string[] args)
{
StandAloneApp.Start(args);
server = StandAloneApp.Start(args);
Console.WriteLine("Press any key to stop the server");
Console.ReadKey();
Console.WriteLine($"{DateTime.UtcNow} Press Ctrl+C to shut down");
System.Console.CancelKeyPress += (s,e) =>
{
Stop("CancelKeyPress");
};
System.Runtime.Loader.AssemblyLoadContext.Default.Unloading += ctx =>
{
Stop("AssemblyLoadContext.Default.Unloading");
};
while(true)
{
Console.WriteLine($"{DateTime.UtcNow} WireMock.Net server running");
Thread.Sleep(sleepTime);
}
}
private static void Stop(string why)
{
Console.WriteLine($"{DateTime.UtcNow} WireMock.Net server stopping because '{why}'");
server.Stop();
Console.WriteLine($"{DateTime.UtcNow} WireMock.Net server stopped");
}
}
}

View File

@@ -2,7 +2,7 @@
"profiles": {
"WireMock.Net.StandAlone.NETCoreApp": {
"commandName": "Project",
"commandLineArgs": "--Urls http://*:9090"
"commandLineArgs": "--Urls http://*:9091"
}
}
}

View File

@@ -2,8 +2,8 @@
<PropertyGroup>
<OutputType>Exe</OutputType>
<TargetFramework>netcoreapp1.0</TargetFramework>
<RuntimeFrameworkVersion>1.0.1</RuntimeFrameworkVersion>
<TargetFrameworks>netcoreapp1.0;netcoreapp2.0</TargetFrameworks>
<!-- <RuntimeFrameworkVersion>1.0.1</RuntimeFrameworkVersion> -->
<ApplicationIcon>../../WireMock.Net-Logo.ico</ApplicationIcon>
</PropertyGroup>