#include "crow.h" extern "C" { #include "ternarytrie.h" } int main() { TernaryTrie *trie = ternarytrie_init(); crow::SimpleApp app; CROW_ROUTE(app, "/").methods(crow::HTTPMethod::Post) ([trie](std::string s){ ternarytrie_add(trie, s.c_str()); return "added"; }); CROW_ROUTE(app, "/").methods(crow::HTTPMethod::Get) ([trie](std::string s){ if (ternarytrie_search(trie, s.c_str())) { return "it's here"; } return "nope"; }); app.port(18080).multithreaded().run(); }