Refer to src-examples for more examples
#include "HttpServer.hpp"
HttpServer g_Server;
int main(int argc, char* argv[])
{
g_Server.use("/", HttpMethod::GET, [](HttpRequest request, HttpResponse& response, const NextFn& next) {
response.setHeader("Content-Type", "text/plain");
response.send("Hello, world!");
});
g_Server.listen(8080);
};- Install CMake
- Run
build.bat, orbuild.shto build this project.
If built successfully, a static library with the name web-server.lib should be found inside build/Release directory.
- WebSockets
- Caching
- SSL Support
This project is open-source under the MIT License. Feel free to modify and contribute!
# Fork the repository
git clone https://github.com/xkingDark/http-server.git
# Create a new branch
git checkout -b feature-branch
# Commit your changes
git commit -m "Added new feature"
# Push to GitHub
git push origin feature-branch
# Submit a Pull Request