mirror of
https://github.com/wiremock/WireMock.Net.git
synced 2026-04-23 16:58:27 +02:00
Updated Settings (markdown)
70
Settings.md
70
Settings.md
@@ -1,15 +1,22 @@
|
|||||||
# FluentMockServerSettings : generic settings
|
# FluentMockServerSettings
|
||||||
The class `FluentMockServerSettings` defines the settings which can be used to configure the WireMock.net server.
|
The interface [IFluentMockServerSettings.cs](https://github.com/WireMock-Net/WireMock.Net/blob/master/src/WireMock.Net/Settings/IFluentMockServerSettings.cs) defines the configuration from the WireMock.Net server.
|
||||||
|
|
||||||
|
### Port
|
||||||
|
The port to listen on.
|
||||||
|
|
||||||
|
### UseSSL
|
||||||
|
Use SSL.
|
||||||
|
|
||||||
### StartAdminInterface
|
### StartAdminInterface
|
||||||
defines to start the admin interface
|
Defines to if the admin interface should be started.
|
||||||
|
|
||||||
### AllowPartialMapping
|
### ReadStaticMappings
|
||||||
defines if the matching should be done with exact matching or partial matching. **Partial matching** means that the best matching mapping is used for a input request. In case this setting is set to null or false, only **Exact matching** is done. This means that only when an exact 100% match is found for an input request, the response is handled. Else you get a error (404).|
|
Defines if the static mappings should be read at startup.
|
||||||
|
|
||||||
|
### WatchStaticMappings
|
||||||
|
Watch the static mapping files + folder for changes when running.
|
||||||
|
|
||||||
# ProxyAndRecordSettings : Proxy and Record
|
### ProxyAndRecordSettings
|
||||||
|
|
||||||
You can enable ProxyAndRecord functionality by defining the *ProxyAndRecordSettings* and by specifying an Url. See code example below.
|
You can enable ProxyAndRecord functionality by defining the *ProxyAndRecordSettings* and by specifying an Url. See code example below.
|
||||||
|
|
||||||
```c#
|
```c#
|
||||||
@@ -34,4 +41,51 @@ Where
|
|||||||
* BlackListedHeaders = Defines a list from headers which will excluded from the saved mappings.
|
* BlackListedHeaders = Defines a list from headers which will excluded from the saved mappings.
|
||||||
|
|
||||||
### Example:
|
### Example:
|
||||||
When you a request like `localhost:9095/earth/story/20170510-terrifying-20m-tall-rogue-waves-are-actually-real`, this request is proxied to the `bbc.com` and the mapping definition is saved to `__admin\mappings\ab38efae-4e4d-4f20-8afe-635533ec2535.json`.
|
When you a request like `localhost:9095/earth/story/20170510-terrifying-20m-tall-rogue-waves-are-actually-real`, this request is proxied to the `bbc.com` and the mapping definition is saved to `__admin\mappings\ab38efae-4e4d-4f20-8afe-635533ec2535.json`.
|
||||||
|
|
||||||
|
### Urls
|
||||||
|
The URLs to listen on, if this is defined the port setting is not used.
|
||||||
|
|
||||||
|
### StartTimeout
|
||||||
|
The StartTimeout from WireMock.Net, default 10 seconds.
|
||||||
|
|
||||||
|
### AllowPartialMapping
|
||||||
|
Defines if the matching should be done with exact matching or partial matching. **Partial matching** means that the best matching mapping is used for a input request. In case this setting is set to null or false, only **Exact matching** is done. This means that only when an exact 100% match is found for an input request, the response is handled. Else you get a error (404).
|
||||||
|
This setting is default set to false.
|
||||||
|
|
||||||
|
### AdminUsername
|
||||||
|
The username needed for __admin access.
|
||||||
|
|
||||||
|
### AdminPassword
|
||||||
|
The password needed for __admin access.
|
||||||
|
|
||||||
|
### RequestLogExpirationDuration
|
||||||
|
The RequestLog expiration in hours (optional).
|
||||||
|
|
||||||
|
### MaxRequestLogCount
|
||||||
|
The MaxRequestLog count (optional).
|
||||||
|
|
||||||
|
### PreWireMockMiddlewareInit
|
||||||
|
Action which is called (with the IAppBuilder or IApplicationBuilder) before the internal WireMockMiddleware is initialized. [Optional]
|
||||||
|
|
||||||
|
### PostWireMockMiddlewareInit
|
||||||
|
Action which is called (with the IAppBuilder or IApplicationBuilder) after the internal WireMockMiddleware is initialized. [Optional]
|
||||||
|
|
||||||
|
### IWireMockLogger
|
||||||
|
The [IWireMockLogger](https://github.com/WireMock-Net/WireMock.Net/blob/master/src/WireMock.Net/Logging/IWireMockLogger.cs) interface which logs Debug, Info, Warning or Error.
|
||||||
|
|
||||||
|
By default this is implemented by a default console logger [WireMockConsoleLogger.cs](https://github.com/WireMock-Net/WireMock.Net/blob/master/src/WireMock.Net/Logging/WireMockConsoleLogger.cs).
|
||||||
|
But also a Null logger is available [WireMockNullLogger.cs](https://github.com/WireMock-Net/WireMock.Net/blob/master/src/WireMock.Net/Logging/WireMockNullLogger.cs).
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Handler to interact with the file system to read and write static mapping files.
|
||||||
|
/// </summary>
|
||||||
|
[PublicAPI]
|
||||||
|
IFileSystemHandler FileSystemHandler { get; set; }
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user