Application Settings
Endatix API exposes application settings, which allow you to configure the behavior of the applicaiton. They are part of the ASP.NET Core configuration framework and support per environment variations similar to .env files with note. More about ASP.NET Configuration here.
For each project that you have setup via the NuGet packages, you can apply the settings via the respective appsettings.{Environment}.json
files there. By convention all settings will be part of the Endatix object in the root of your settings, so there's virtually no change of name colission with other settings you might have.. an it's also cleaner. Here is an example:
{
"ConnectionStrings": {...
},
"Serilog": {...
},
"Endatix": {
"Data": {...
},
"Jwt": {...
},
"Cors": {...
}
}
}
The files are by default shipped with your Endatix.WebHost
application located in src\Endatix.WebHost
. There you will see 2 files:
appSettings.Development.json
- used for Development settingsappSettings.json
- used for default settings.
Itβs recommended to use an appSettings.Production.json
file for your production environment to keep sensitive configurations, such as API keys and connection strings, separate from development settings. This ensures that production-specific settings are securely managed and reduces the risk of accidentally exposing sensitive data during development or deployment.
ποΈ Data Settings
Data settings control the behavior of the data persistence layer, including database migrations and sample data seeding.
ποΈ JWT Settings
JWT (JSON Web Token) settings control the authentication and authorization mechanisms in Endatix. These settings are essential for securing your API and client interactions, ensuring that only authorized users can access protected resources.
ποΈ Persistence Settings
Persistence settings control how Endatix interacts with your database, including which database provider to use, connection strings, and migration behavior.
ποΈ CORS Settings
This guide will help you configure CORS (Cross-Origin Resource Sharing) settings for the Endatix application. By default if you omit the settings default CORS settings will be applied:
ποΈ Health Checks
Health checks are an important part of any application for monitoring its health and dependencies. Endatix provides built-in health check functionality that is configured automatically by default.