Ecosyste.ms: Awesome

An open API service indexing awesome lists of open source software.

Awesome Lists | Featured Topics | Projects

https://github.com/wandvvs/void-http

Simple HTTP web server created for educational purposes with boost.asio
https://github.com/wandvvs/void-http

boost boost-asio boostasio cplusplus cpp cpp20 network server tcp tcp-server web-server

Last synced: about 6 hours ago
JSON representation

Simple HTTP web server created for educational purposes with boost.asio

Awesome Lists containing this project

README

        

# void-http

Simple HTTP web server created for educational purposes with boost.asio

Example:
```cpp
#include "void_server.h"

int main(int, char**) {
void_http::server server("127.0.0.1", 5111);

server.set_not_found_handler([&](){
server.write("not found");
});
server.get("/", [&]() {
server.write_from_file("index.html");
});

server.get("/profile", [&]() {
server.write("

Profile

Test

");
});

server.post("/testik", [&](nlohmann::json& data) {
std::cout << "Received name: " << data["name"] << std::endl;
std::cout << "Received age: " << data["age"] << std::endl;
});

server.run();

return 0;
}
```