mirror of
https://github.com/wiremock/WireMock.Net.git
synced 2026-04-27 11:17:31 +02:00
Updated WireMock as a standalone process (markdown)
@@ -1,6 +1,37 @@
|
|||||||
##WireMock as a standalone process
|
## WireMock as a standalone process
|
||||||
This is quite straight forward to launch a mock server within a console application.
|
This is quite straight forward to launch a mock server within a console application.
|
||||||
|
|
||||||
|
### Option 1 : using the WireMock.Net.StandAlone library (https://www.nuget.org/packages/WireMock.Net.StandAlone/)
|
||||||
|
```c#
|
||||||
|
class Program
|
||||||
|
{
|
||||||
|
static void Main(string[] args)
|
||||||
|
{
|
||||||
|
StandAloneApp.Start(args);
|
||||||
|
|
||||||
|
Console.WriteLine("Press any key to stop the server");
|
||||||
|
Console.ReadKey();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
```
|
||||||
|
|
||||||
|
### Option 2 : using the WireMock.Net.StandAlone library using the settings object
|
||||||
|
```c#
|
||||||
|
class Program
|
||||||
|
{
|
||||||
|
static void Main(string[] args)
|
||||||
|
{
|
||||||
|
var settings = new FluentMockServerSettings { }; // see source code for all the possible properties
|
||||||
|
bool allowPartialMapping = true;
|
||||||
|
StandAloneApp.Start(settings, allowPartialMapping);
|
||||||
|
|
||||||
|
Console.WriteLine("Press any key to stop the server");
|
||||||
|
Console.ReadKey();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
```
|
||||||
|
|
||||||
|
### Option 3 : coding yourself
|
||||||
```c#
|
```c#
|
||||||
static void Main(string[] args)
|
static void Main(string[] args)
|
||||||
{
|
{
|
||||||
|
|||||||
Reference in New Issue
Block a user