diff options
| author | frosty <frosty@illegalfirearms.store> | 2026-01-06 23:46:24 -0500 |
|---|---|---|
| committer | frosty <frosty@illegalfirearms.store> | 2026-01-06 23:46:24 -0500 |
| commit | f3aa7ca0bc2ef7c286609e8f87d07cc2568093af (patch) | |
| tree | 269352af1238b4dd7c3e2e023f71a27b858cdb34 /src/Main.c | |
rebase(d)
Diffstat (limited to 'src/Main.c')
| -rw-r--r-- | src/Main.c | 36 |
1 files changed, 36 insertions, 0 deletions
diff --git a/src/Main.c b/src/Main.c new file mode 100644 index 0000000..ad08f3e --- /dev/null +++ b/src/Main.c @@ -0,0 +1,36 @@ +#include <beaker.h> +#include <curl/curl.h> +#include <libxml/parser.h> +#include <stdio.h> +#include <stdlib.h> + +#include "Config.h" +#include "Routes/Home.h" +#include "Routes/Images.h" +#include "Routes/Search.h" + +int main() { + LIBXML_TEST_VERSION + xmlInitParser(); + + curl_global_init(CURL_GLOBAL_DEFAULT); + + set_handler("/", home_handler); + set_handler("/search", results_handler); + set_handler("/images", images_handler); + + fprintf(stderr, "Starting Omnisearch on %s:%d\n", host, port); + + int result = beaker_run(host, port); + + if (result != 0) { + fprintf(stderr, "Error: Beaker server failed to start.\n"); + curl_global_cleanup(); + xmlCleanupParser(); + return EXIT_FAILURE; + } + + curl_global_cleanup(); + xmlCleanupParser(); + return EXIT_SUCCESS; +} |
