first release 0.1.1

This commit is contained in:
2025-05-30 16:44:39 +02:00
parent 3d3264d8d6
commit 71f771b428
9 changed files with 41 additions and 31 deletions

View File

@@ -3,6 +3,7 @@
#include <sstream>
#include <cstdlib>
#include <string>
#include <print>
#include <optional>
#include "json_settings.h"
#include "htmx_helper.h"
@@ -68,5 +69,19 @@ int main() {
return crow::response{row.htmx()};
});
app.port(8080).multithreaded().run();
const uint16_t defaultPort = 3010;
uint16_t httpPort = defaultPort;
{
auto opt_settings = AppSettings::loadAppSettings();
if (opt_settings.has_value()){
auto& settings = opt_settings.value();
httpPort = settings.httpPort.value_or(defaultPort);
} else {
CROW_LOG_ERROR << "failed to load settings : " << opt_settings.error();
}
}
app.loglevel(crow::LogLevel::INFO);
app.port(httpPort).multithreaded().run();
}