MXMSConfiguration: Difference between revisions
| (25 intermediate revisions by the same user not shown) | |||
| Line 1: | Line 1: | ||
An example which injects loads the default configuration and overrides a few settings. | |||
<pre> | |||
public void ConfigureServices(IServiceCollection services) | |||
{ | |||
var mxms = services.AddMXMS(_env, _config) | |||
.WithDefaultConfigurationAndApplication() | |||
.WithEntityStoreConfiguration(i => | |||
{ | |||
i.AutoUpdateDatastore = true; | |||
}) | |||
.WithEnvironmentConfiguration(i => | |||
{ | |||
i.Culture = new System.Globalization.CultureInfo("nl-NL"); | |||
}); | |||
if (_env.IsDevelopment()) | |||
{ | |||
mxms.EnableDebug(); | |||
} | |||
mxms.Build(); | |||
} | |||
</pre> | |||
== Environment configuration == | == Environment configuration == | ||
The Environment configuration section provides various settings in regards to it's hosting environment and folders within that hosting environment. MXMS provides a sane default configuration, with the possibility to override these settings. | |||
=== Workingdirectory === | === Workingdirectory === | ||
MXMS stores certain files to the file system. For this MXMS needs a directory within the hosting environment in which the application has full access rights. The default location for this directory is <APPLICATION_ROOT_DIRECTORY>mxms/. This directory name can be overridden using the WorkingDirectory configuration property. The value should be a relative path e.g. "mxms/". Absolute path's are not allowed. | |||
<pre> | |||
.WithEnvironmentConfiguration(i => | |||
{ | |||
i.WorkingDirectory = "mxms/"; | |||
}) | |||
</pre> | |||
=== Listenpath === | |||
By default MXMS can be reached using the root URL, e.g. https://mxms.example.com. If you would like MXMS to listen on a subpath e.g. https://mxms.example.com/mxms/ configure the listenpath using this configuration property | |||
<pre> | |||
.WithEnvironmentConfiguration(i => | |||
{ | |||
i.ListenPath = "/mxms/"; | |||
}) | |||
</pre> | |||
=== Culture === | |||
MXMS has multi language support. To specify the language, currency and numeric formats specify the culture using this property. The property expects a culture instance. | |||
<pre> | |||
.WithEnvironmentConfiguration(i => | |||
{ | |||
i.Culture = new System.Globalization.CultureInfo("nl-NL"); | |||
}) | |||
</pre> | |||
=== TimezoneOffset === | |||
MXMS uses UTC for it's time format. For scheduled tasks and other functionality to use localtime a Timezone offset can be configured. | |||
<pre> | |||
.WithEnvironmentConfiguration(i => | |||
{ | |||
i.TimezoneOffset = 8; | |||
}) | |||
</pre> | |||
== Logging configuration == | == Logging configuration == | ||
<pre> | |||
.WithLoggingConfiguration(i => | |||
{ | |||
// Configuration changes here | |||
}) | |||
</pre> | |||
== Entity store configuration == | == Entity store configuration == | ||
<pre> | |||
.WithEntityStoreConfiguration(i => | |||
{ | |||
// Configuration changes here | |||
}) | |||
</pre> | |||
== Security configuration == | == Security configuration == | ||
<pre> | |||
.WithSecurityConfiguration(i => | |||
{ | |||
// Configuration changes here | |||
}) | |||
</pre> | |||
== API configuration == | == API configuration == | ||
<pre> | |||
.WithAPIConfiguration(i => | |||
{ | |||
// Configuration changes here | |||
}) | |||
</pre> | |||
Latest revision as of 07:14, 31 March 2026
An example which injects loads the default configuration and overrides a few settings.
public void ConfigureServices(IServiceCollection services)
{
var mxms = services.AddMXMS(_env, _config)
.WithDefaultConfigurationAndApplication()
.WithEntityStoreConfiguration(i =>
{
i.AutoUpdateDatastore = true;
})
.WithEnvironmentConfiguration(i =>
{
i.Culture = new System.Globalization.CultureInfo("nl-NL");
});
if (_env.IsDevelopment())
{
mxms.EnableDebug();
}
mxms.Build();
}
Environment configuration
The Environment configuration section provides various settings in regards to it's hosting environment and folders within that hosting environment. MXMS provides a sane default configuration, with the possibility to override these settings.
Workingdirectory
MXMS stores certain files to the file system. For this MXMS needs a directory within the hosting environment in which the application has full access rights. The default location for this directory is <APPLICATION_ROOT_DIRECTORY>mxms/. This directory name can be overridden using the WorkingDirectory configuration property. The value should be a relative path e.g. "mxms/". Absolute path's are not allowed.
.WithEnvironmentConfiguration(i =>
{
i.WorkingDirectory = "mxms/";
})
Listenpath
By default MXMS can be reached using the root URL, e.g. https://mxms.example.com. If you would like MXMS to listen on a subpath e.g. https://mxms.example.com/mxms/ configure the listenpath using this configuration property
.WithEnvironmentConfiguration(i =>
{
i.ListenPath = "/mxms/";
})
Culture
MXMS has multi language support. To specify the language, currency and numeric formats specify the culture using this property. The property expects a culture instance.
.WithEnvironmentConfiguration(i =>
{
i.Culture = new System.Globalization.CultureInfo("nl-NL");
})
TimezoneOffset
MXMS uses UTC for it's time format. For scheduled tasks and other functionality to use localtime a Timezone offset can be configured.
.WithEnvironmentConfiguration(i =>
{
i.TimezoneOffset = 8;
})
Logging configuration
.WithLoggingConfiguration(i =>
{
// Configuration changes here
})
Entity store configuration
.WithEntityStoreConfiguration(i =>
{
// Configuration changes here
})
Security configuration
.WithSecurityConfiguration(i =>
{
// Configuration changes here
})
API configuration
.WithAPIConfiguration(i =>
{
// Configuration changes here
})