-
Notifications
You must be signed in to change notification settings - Fork 28
Configuration
龙卷锋 edited this page Apr 16, 2020
·
21 revisions
config/application.conf
# Upload
upload.path = attachments/
upload.maxSize = 4096000
import hunt.framework.Simplify;
long uploadMaxSize = config().upload.maxSize;
More item value reference file ApplicationConfig.d
The custom test.conf file is in the config/ directory
setting.welcome= hello
The custom TestConfig.d file is in the source/app/config/ directory
module app.config.TestConfig;
import hunt.util.Configuration;
@ConfigurationFile("test") // Consistent with conf file name
class TestConfig
{
SettingConfig setting;
}
struct SettingConfig
{
string welcome;
}
import hunt.framework.Simplify;
import app.config.TestConfig;
auto testConfig = configManager().load!TestConfig();
string welcome = testConfig.setting.welcome;