From afdd7e9b69b26aa7fadb65a0da6aa9a21341bc4c Mon Sep 17 00:00:00 2001 From: Niklas Halle Date: Wed, 26 Aug 2020 14:38:20 +0200 Subject: :( --- src/main.cpp | 22 +++++++--------------- 1 file changed, 7 insertions(+), 15 deletions(-) (limited to 'src/main.cpp') diff --git a/src/main.cpp b/src/main.cpp index 8289584..562e20b 100644 --- a/src/main.cpp +++ b/src/main.cpp @@ -2,7 +2,6 @@ #include #include #include -#include #include "crow.h" @@ -13,7 +12,6 @@ #include "GetEssen.hpp" #include "SimpleHandlers.hpp" #include "RelationshipHandler.hpp" - /* END Handlers */ int main() { @@ -47,9 +45,7 @@ int main() { CROW_ROUTE(app, "/") .methods("POST"_method) - ([&commands]( - crow::request const &request - ) { + ([&commands](crow::request const &request) { auto data = crow::json::load(request.body); if (!data) @@ -58,8 +54,8 @@ int main() { if (!data.count("command")) return crow::response(400, "malformed request: missing `command` field\n"); - std::string command = (data.count("command") ? data["command"].s() : std::string( - "No such command!")); + std::string command = (data.count("command") ? data["command"].s() : + std::string("No such command!")); std::string arguments = (data.count("arguments") ? data["arguments"].s() : std::string("")); std::string session = (data.count("session") ? data["session"].s() : std::string("null")); @@ -77,14 +73,10 @@ int main() { Response::simple_response("No such command!", "null", false)}; }); - app.port(18080). - - multithreaded() - - . + app.port(18080).multithreaded().run(); - run(); + for (auto &&it : commands) + delete it.description; - std::cout << "Stopped successfully" << - std::endl; + std::cout << "Stopped successfully" << std::endl; } -- cgit v1.2.3-54-g00ecf