Skip to content

Commit

Permalink
⚒️use different appsettings from env
Browse files Browse the repository at this point in the history
  • Loading branch information
Lord-Turmoil committed Dec 1, 2024
1 parent 08d1389 commit 4963919
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions src/core/WebHostBuilder.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@
#include "components/MayhemServer.h"
#include "components/RequestDispatcher.h"

#include <cstdlib>
#include <fstream>
#include <iostream>

Expand Down Expand Up @@ -35,6 +36,14 @@ Ref<WebHostBuilder> WebHostBuilder::UseAppSettings(const std::string& path)
_initialized = true;

_appSettingsPath = path;
if (_appSettingsPath == "appsettings.json")
{
const char* env = std::getenv("MINET_CORE_ENV");
if (env)
{
_appSettingsPath = std::string("appsettings.") + env + ".json";
}
}
_InitializeComponents();

return shared_from_this();
Expand Down

0 comments on commit 4963919

Please sign in to comment.