CSharpHttpServer/SimpleHttpServer/SimpleHttpServerConfiguration.cs

24 lines
1.1 KiB
C#

namespace SimpleHttpServer;
public class SimpleHttpServerConfiguration {
public delegate void CustomLogMessageHandler(LogOutputTopic topic, string message, LogOutputLevel logLevel);
/// <summary>
/// If set to true, log messages will not be printed to the console, and instead will only be outputted by calling <see cref="LogMessageHandler"/>.
/// If set to false, the aforementioned delegate will still be invoked, but messages will still be printed to the console.
/// Setting this to false and <see cref="LogMessageHandler"/> to null will effectively disable log output completely.
/// </summary>
public bool DisableLogMessagePrinting { get; init; } = false;
/// <summary>
/// See description of <see cref="DisableLogMessagePrinting"/>
/// </summary>
public CustomLogMessageHandler? LogMessageHandler { get; init; } = null;
/// <summary>
/// If set to true, paths ending with / are identical to paths without said trailing slash. E.g. /index is then the same as /index/
/// </summary>
public bool TrimTrailingSlash { get; init; } = true;
public SimpleHttpServerConfiguration() { }
}