Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
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
- Host: GitHub
- URL: https://github.com/wandvvs/void-http
- Owner: wandvvs
- Created: 2024-05-05T15:33:04.000Z (6 months ago)
- Default Branch: main
- Last Pushed: 2024-05-05T15:37:21.000Z (6 months ago)
- Last Synced: 2024-05-10T19:54:55.074Z (6 months ago)
- Topics: boost, boost-asio, boostasio, cplusplus, cpp, cpp20, network, server, tcp, tcp-server, web-server
- Language: C++
- Homepage:
- Size: 1.13 MB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
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;
}
```