From b4157a57e1c2c82c46ad7a8e98376fd724bf080a Mon Sep 17 00:00:00 2001 From: LeonardoBizzoni Date: Fri, 7 Feb 2025 11:44:38 +0100 Subject: [PATCH] Added README --- README.org | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+) create mode 100644 README.org diff --git a/README.org b/README.org new file mode 100644 index 0000000..30aba72 --- /dev/null +++ b/README.org @@ -0,0 +1,21 @@ +* Example +#+begin_src cpp :tangle src/main.cpp +#include +#include "http.h" + +int main() { + auto server = http::Listener::on_local(8800); + + server.value().routes["GET /"] = [](const http::Request &req) -> http::Response { + std::cout << req << std::endl; + + http::Response resp; + resp.status = http::Status::OK; + resp.body = "

Hello, World!

"; + + return resp; + }; + + server.value().serve(); +} +#+end_src -- 2.52.0