mirror of
https://github.com/wiremock/WireMock.Net.git
synced 2026-01-14 22:33:35 +01:00
34 lines
1.1 KiB
C#
34 lines
1.1 KiB
C#
using Newtonsoft.Json;
|
|
using WireMock.Server;
|
|
using WireMock.Settings;
|
|
|
|
namespace WireMock.Net.Console.Record.NETCoreApp
|
|
{
|
|
static class Program
|
|
{
|
|
static void Main(params string[] args)
|
|
{
|
|
var server = FluentMockServer.Start(new FluentMockServerSettings
|
|
{
|
|
Urls = new[] { "http://localhost:9095/", "https://localhost:9096/" },
|
|
StartAdminInterface = true,
|
|
ProxyAndRecordSettings = new ProxyAndRecordSettings
|
|
{
|
|
Url = "https://www.msn.com",
|
|
SaveMapping = true
|
|
}
|
|
});
|
|
|
|
System.Console.WriteLine("Press any key to stop the server");
|
|
System.Console.ReadKey();
|
|
server.Stop();
|
|
|
|
System.Console.WriteLine("Displaying all requests");
|
|
var allRequests = server.LogEntries;
|
|
System.Console.WriteLine(JsonConvert.SerializeObject(allRequests, Formatting.Indented));
|
|
|
|
System.Console.WriteLine("Press any key to quit");
|
|
System.Console.ReadKey();
|
|
}
|
|
}
|
|
} |