Wisp provides flexible configuration options to tailor the framework and your application’s behavior. This page outlines the available configuration settings and how to customize them.
By default, Wisp loads configuration from a JSON file named wisp.application.json
located in the application root.
You can extend or override this by providing additional configuration sources via the WispHostBuilder.Configure
method.
Example:
var builder = new WispHostBuilder()
.Configure(configBuilder =>
{
configBuilder.AddEnvironmentVariables();
configBuilder.AddJsonFile("appsettings.local.json", optional: true);
});
Wisp
The framework expects a configuration section named Wisp
that maps to the WispConfiguration
class. This section
contains key runtime settings.
wisp.application.json
example:{
"Wisp": {
"Host": "127.0.0.1",
"Port": 6969,
"LogLevel": "Information"
}
}
Setting | Type | Description | Default |
---|---|---|---|
Host | string | IP address to bind the HTTP server to | '127.0.0.1' |
Port | int | TCP port for the HTTP server | 6969 |
LogLevel | string | Logging Level | Information |
Wisp uses Microsoft's dependency injection (DI) container to manage services.
You can add or modify services during startup using WispHostBuilder.ConfigureServices
.
Example:
var builder = new WispHostBuilder()
.ConfigureServices(services =>
{
services.AddSingleton<IMyService, MyService>();
services.Configure<MySettings>(config.GetSection("MySettings"));
});
This allows you to:
Wisp now supports flexible logging configuration via WispHostBuilder.ConfigureLogging
.
By default, it adds a simple console logger.
Example of overriding or extending the default logging setup:
var builder = new WispHostBuilder()
.ConfigureLogging(logging =>
{
logging.SetMinimumLevel(LogLevel.Information);
logging.AddFilter("MyApp.Namespace", LogLevel.Warning);
logging.AddDebug();
});
Behind the scenes, this merges your logging configuration with the defaults, ensuring sensible logging out of the box but giving you full control.
Host
and Port
).IHttpServer
service in ConfigureServices
.Extension Point | Method | Description |
---|---|---|
Add custom config sources | WispHostBuilder.Configure |
Add JSON, environment variables, etc. |
Register or override services | WispHostBuilder.ConfigureServices |
Add your own services or replace defaults |
Customize logging | WispHostBuilder.ConfigureLogging |
Add, remove or adjust logging providers and filters |
Enable controllers | WispApplicationBuilder.UseControllers |
Registers controllers automatically |
Add routes manually | WispApplicationBuilder.ConfigureRoutes |
Define lightweight routes |
Build()
is called on the host builder.IConfiguration
or bound options classes.