diff options
| author | frosty <frosty@illegalfirearms.store> | 2026-01-21 21:41:17 -0500 |
|---|---|---|
| committer | frosty <frosty@illegalfirearms.store> | 2026-01-21 21:41:17 -0500 |
| commit | 12a71a892251146bfcd45002e4ce93ec9da15941 (patch) | |
| tree | 131b230188998c4e83b623f2b5695fcbb00b6d8e /src/Main.c | |
| parent | 50301a037c38d3197f85baf40d6b69122e33ee1b (diff) | |
added config
Diffstat (limited to 'src/Main.c')
| -rw-r--r-- | src/Main.c | 12 |
1 files changed, 9 insertions, 3 deletions
@@ -15,13 +15,19 @@ int main() { curl_global_init(CURL_GLOBAL_DEFAULT); + Config config = {.host = "0.0.0.0", .port = 5000}; + + if (load_config("config.ini", &config) != 0) { + fprintf(stderr, "Warning: Could not load config file, using defaults\n"); + } + set_handler("/", home_handler); set_handler("/search", results_handler); set_handler("/images", images_handler); - fprintf(stderr, "Starting Omnisearch on %s:%d\n", host, port); + fprintf(stderr, "Starting Omnisearch on %s:%d\n", config.host, config.port); - int result = beaker_run(host, port); + int result = beaker_run(config.host, config.port); if (result != 0) { fprintf(stderr, "Error: Beaker server failed to start.\n"); @@ -33,4 +39,4 @@ int main() { curl_global_cleanup(); xmlCleanupParser(); return EXIT_SUCCESS; -} +}
\ No newline at end of file |
