diff --git a/tech/C++.wiki b/tech/C++.wiki index 22553a3..1299d98 100644 --- a/tech/C++.wiki +++ b/tech/C++.wiki @@ -3,6 +3,10 @@ Object Oriented super set of C. Great for larger projects, with minimal drawbacks due to the Object abstraction. +== Frameworks and libraries == + +* [[Crow]] + == Features == * [[constexpr]] diff --git a/tech/Crow.wiki b/tech/Crow.wiki new file mode 100644 index 0000000..091ed08 --- /dev/null +++ b/tech/Crow.wiki @@ -0,0 +1,52 @@ += Crow = + +Crow is a fast, [[flask]]-like C++ microframework + +== Apps == + +Crow provides a `crow::App` type that comes in two flavors + +* `crow::SimpleApp` + * no middle ware +* `crow::App` + * uses m1, m2, etc. middleware + +Some other usefule interfaces + +* `bindaddr(192.168.1.144)` + * takes an IP addr to bind to +* `.port(443)` + * takes an int port to listen on +* `.multithreaded()` + * enable multithreaded request handling +* `.run()` + * Run the app + * Run is blocking, use `run_async` for non blocking + +== Routes == + +Routes assign URLs to function calls. To assign a route, use the macro + +`CROW_ROUTE(app, url)` + +where, +* `app` is the app class to assign the route to +* `url` is the relative path is assigned to the route + * paths can take paramaters + * `/hello/` + * paramaters can be + * `int` + * `uint` + * `double` + * `string` + * `path` + +HTTP methods can also be changed on routes via the `.method()` call, appended +to the `CROW_ROUTE` macro. + +HTTP methods include +* `crow::HTTPMethod::GET` +* `crow::HTTPMethod::PATCH` +* `crow::HTTPMethod::POST` + +=== Catchall route ===