lander/src/main.c

28 lines
615 B
C

#include <stdio.h>
#include "lander.h"
#include "log.h"
int main() {
setvbuf(stdout, NULL, _IONBF, 0);
info("Initializing trie");
Trie *trie;
TrieExitCode res = trie_init(&trie, "lander.data");
if (res != Ok) {
critical(1, "An error occured while populating the trie.");
}
info("Trie initialized and populated with %i entries", trie_size(trie));
http_loop_gctx *gctx = http_loop_gctx_init();
gctx->trie = trie;
gctx->routes = lander_routes;
gctx->route_count = sizeof(lander_routes) / sizeof(lander_routes[0]);
event_loop *el = http_loop_init(gctx);
http_loop_run(el, 8000);
}