{"id":15047570,"url":"https://github.com/gaurav-deep01/miniserver","last_synced_at":"2025-08-26T16:07:40.089Z","repository":{"id":253531569,"uuid":"843787991","full_name":"GAURAV-DEEP01/MiniServer","owner":"GAURAV-DEEP01","description":"Http/1.1 Server build from scratch using cpp. Has Routing API and can be used as a Library ( don't )","archived":false,"fork":false,"pushed_at":"2025-07-01T19:13:21.000Z","size":1097,"stargazers_count":1,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-07-01T20:24:48.863Z","etag":null,"topics":["cpp17","https-server","make","socket-programming"],"latest_commit_sha":null,"homepage":"","language":"C++","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/GAURAV-DEEP01.png","metadata":{"files":{"readme":"Readme.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE.md","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null}},"created_at":"2024-08-17T12:23:24.000Z","updated_at":"2025-07-01T19:13:24.000Z","dependencies_parsed_at":"2024-08-25T13:46:05.097Z","dependency_job_id":"0a6adb3a-3ccb-4817-8072-4ffb7ec89958","html_url":"https://github.com/GAURAV-DEEP01/MiniServer","commit_stats":null,"previous_names":["gaurav-deep01/miniserver"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/GAURAV-DEEP01/MiniServer","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/GAURAV-DEEP01%2FMiniServer","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/GAURAV-DEEP01%2FMiniServer/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/GAURAV-DEEP01%2FMiniServer/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/GAURAV-DEEP01%2FMiniServer/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/GAURAV-DEEP01","download_url":"https://codeload.github.com/GAURAV-DEEP01/MiniServer/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/GAURAV-DEEP01%2FMiniServer/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":272235331,"owners_count":24897184,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","status":"online","status_checked_at":"2025-08-26T02:00:07.904Z","response_time":60,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["cpp17","https-server","make","socket-programming"],"created_at":"2024-09-24T21:00:27.391Z","updated_at":"2025-08-26T16:07:40.081Z","avatar_url":"https://github.com/GAURAV-DEEP01.png","language":"C++","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Mini Server\n\nMini Server is a lightweight C++ HTTP/1.1 server built from scratch it's easily modifiable and has simple routing API.\n\n```cpp\nHttpServer app;\n\napp.Get(\"/\",[](Request \u0026req, Response \u0026res) -\u003e int {\n    res.setContentType(\"text/html\");\n    res.send(\"\u003ch1\u003eServer is running!\u003ch1\u003e\");\n    return 0;\n});\n\napp.listen(9090);\n```\n\n## Request Lifecycle Overview\n\nThe following sequence diagram shows the flow of a typical HTTP request handled by MiniServer:\n\n![MiniServer Request Lifecycle](./Documentation/images/MiniServer-SequenceDiagram.png)\n\n## Features\n\n- **Lightweight HTTP Server:** Handles HTTP requests GET, POST, PUT, DELETE, POST and other methods using method SPECIFIC.\n- **Connection keep-alive**: This is a HTTP/1.1 feature for persistant connection\n- **Routing System:** Define routes with lambda functions.\n- **Customizable Responses:** Set content type, status codes, and more.\n\n## Quick Start\n\n### Prerequisites\n\n- Windows\n- C++17 or later\n- A compatible compiler (G++)\n- Make build tool\n\n### Cloning the Repository\n\n```cmd\ngit clone https://github.com/GAURAV-DEEP01/MiniServer.git\ncd MiniServer\n```\n\n### Building the Project\n\n#### Using Make build the project\n\nCompiles the whole project and will output `Webserver.exe` inside a `exe` folder in you project directory\n\n```cmd\nmake build\n```\n\nIf you dont have Make build tool use this\n\nstep 1: create a directory exe\n\n```cmd\nmkdir -p exe\n```\n\nstep 2: build the project\n\n```cmd\ng++ -o exe/WebServer MiniServer/src/HttpServer.cpp MiniServer/src/Logger.cpp MiniServer/src/RequestHandler.cpp MiniServer/src/HttpRequest.cpp MiniServer/src/HttpResponse.cpp -lws2_32 server.cpp -IMiniServer/include\n```\n\n- If you dont want to run the whole project, you can use it as a library instead view [How to use MiniServer as Library](/Documentation/Library.md)\n\n### Running the Server\n\n```cmd\n./WebServer\n```\n\nNow, checkout `localhost:23000/` on your browser\n\n![MiniServer running on port 23000](./Documentation/images/MiniServerPage.png)\n\n\n## Simple Example Usage\n\nYou can define routes and handle requests using the following API:\n\n```cpp\n// Inside the main create a HttpServer instance\nHttpServer app;\n\n\n// Define route method (There are routes for other HTTP methods too)\napp.Get(\"/\",[](Request \u0026req, Response \u0026res) -\u003e int\n{\n    res.setContentType(\"text/html\");\n    res.send(\"\u003ch1\u003eServer is running!\u003ch1\u003e\");\n    return 0;\n});\n\n// Listen on a port (This method invokation should be after all the 'route' definition)\napp.listen(9090);\n```\n\nNow, checkout `localhost:9090/` on your browser\n\n## Documentation\n\n- [How does Routing and everything Work](/Documentation/Routes.md)\n- [How to use Miniserver as Library](/Documentation/Library.md)\n\n- Documentation for Windows socket API [winsock2.h](https://learn.microsoft.com/en-us/windows/win32/api/winsock2/)\n\n## Contributing\n\nContributions are welcome! Please submit a pull request or open an issue to discuss any changes.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fgaurav-deep01%2Fminiserver","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fgaurav-deep01%2Fminiserver","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fgaurav-deep01%2Fminiserver/lists"}