config.hpp 496 B

12345678910111213141516171819
  1. #pragma once
  2. #include <cstdint>
  3. #include <string>
  4. #include <nlohmann/json.hpp>
  5. namespace svapi {
  6. struct Config {
  7. std::string logLevel = "info";
  8. std::string httpBind = "0.0.0.0";
  9. uint16_t httpPort = 8080;
  10. std::string dbAddress = "localhost:9004";
  11. std::string webuiDir = "/usr/share/smartbotic-vectorapi/webui";
  12. static Config fromJson(const nlohmann::json& j);
  13. static Config load(const std::string& path); // reads file then fromJson
  14. };
  15. } // namespace svapi