# httpserver **Repository Path**: starte/httpserver ## Basic Information - **Project Name**: httpserver - **Description**: 使用纯C++ stl 建立http服务器。不依赖任何第三方框架 - **Primary Language**: Unknown - **License**: Apache-2.0 - **Default Branch**: master - **Homepage**: None - **GVP Project**: No ## Statistics - **Stars**: 0 - **Forks**: 0 - **Created**: 2021-08-04 - **Last Updated**: 2022-05-30 ## Categories & Tags **Categories**: Uncategorized **Tags**: None ## README ### about simple c++ http server. use epoll and threads pool. **supoorts GET Method only.** ### denpends C++ 17 std CMake >=3.16 ### build build and run example server: ``` $git clone https://github.com/ogood/httpserver.git $cd httpserver $mkdir build && cd build && cmake .. && make $./server ``` ### usage simple as the example (/test.cpp): ``` #include #include #include #include int main(int argc, char** argv) { Http::Router router; router.set_static("/static/", std::filesystem::current_path().string()); router.add_handler("/hello", [](Http::Client* c) { c->set_head("Token", "123456"); c->reply.body = "hello world"; }); Http::Service s(&router,8080); s.start(); return 0; } ```