Skip to main content

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 settings
  • appSettings.json - used for default settings.
tip

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.