https://github.com/dudoslav/yahs
Yet Another HTTP Server
https://github.com/dudoslav/yahs
Last synced: 3 months ago
JSON representation
Yet Another HTTP Server
- Host: GitHub
- URL: https://github.com/dudoslav/yahs
- Owner: dudoslav
- Created: 2020-03-31T14:08:00.000Z (about 5 years ago)
- Default Branch: master
- Last Pushed: 2020-05-25T12:54:32.000Z (about 5 years ago)
- Last Synced: 2024-12-27T03:20:19.537Z (5 months ago)
- Language: C++
- Size: 26.4 KB
- Stars: 2
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# yahs
Yet Another HTTP ServerYAHS is actually not a server, but a framework for making web apps.
It was inspired by Express.js. The request handling
process is multithreaded. This project is still under development.On my machine with 4 cores (8 threads) I can get around 12k requests/sec.
Tests were done using ApacheBench `ab -n 10000 -c 100 localhost:8080`.# Usage
The basic server can look as follows "main.cpp":
```
#includeauto main() -> int {
auto index = http::get("/?", [](const auto& m, const auto& req, auto& conn){
conn << http::response_ok() << http::endl;
});
auto app = http::Application{index};
auto server = net::make_tcp_server(8080);
server.listen(app);return 0;
}```
# Installation
This project uses CMake, so the installation process should be straight forward:
```
mkdir build && cd build
cmake ..
make
sudo make install
```