{"id":13424623,"url":"https://github.com/wfrest/wfrest","last_synced_at":"2025-07-02T15:03:51.879Z","repository":{"id":42588970,"uuid":"421833937","full_name":"wfrest/wfrest","owner":"wfrest","description":"C++ Web Framework REST API","archived":false,"fork":false,"pushed_at":"2025-04-28T08:39:57.000Z","size":2720,"stargazers_count":939,"open_issues_count":28,"forks_count":141,"subscribers_count":15,"default_branch":"main","last_synced_at":"2025-04-28T09:58:12.622Z","etag":null,"topics":["cpp","http","restful-api","workflow"],"latest_commit_sha":null,"homepage":"","language":"C++","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/wfrest.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","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":"2021-10-27T13:40:22.000Z","updated_at":"2025-04-28T08:40:01.000Z","dependencies_parsed_at":"2023-02-18T17:16:30.164Z","dependency_job_id":"b89d9b96-2a28-419b-b1bc-802420a04ddd","html_url":"https://github.com/wfrest/wfrest","commit_stats":null,"previous_names":[],"tags_count":9,"template":false,"template_full_name":null,"purl":"pkg:github/wfrest/wfrest","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/wfrest%2Fwfrest","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/wfrest%2Fwfrest/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/wfrest%2Fwfrest/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/wfrest%2Fwfrest/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/wfrest","download_url":"https://codeload.github.com/wfrest/wfrest/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/wfrest%2Fwfrest/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":263163012,"owners_count":23423490,"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","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":["cpp","http","restful-api","workflow"],"created_at":"2024-07-31T00:00:57.112Z","updated_at":"2025-07-02T15:03:51.840Z","avatar_url":"https://github.com/wfrest.png","language":"C++","readme":"[中文版入口](README_cn.md)\n\n# ✨ wfrest: C++ Web Framework REST API\n\nFast🚀, efficient⌛️, and easiest💥 c++ async micro web framework based on [✨**C++ Workflow**✨](https://github.com/sogou/workflow).\n\n[**C++ Workflow**](https://github.com/sogou/workflow) is a light-weighted C++ Parallel Computing and Asynchronous Networking Engine.\n\nIf you need performance and good productivity, you will love ✨**wfrest**✨.\n\n## Contents\n\n- [✨wfrest: C++ Web Framework REST API](#wfrest:-c++-web-framework-rest-api)\n    - [Discussion](#dicssussion)\n    - [Contents](#contents)\n    - [Build](#build)\n        - [Shell](#shell)\n        - [CMake](#cmake)\n        - [XMake](#xmake)\n        - [Docker](#docker)\n    - [Quick start](#quick-start)\n    - [API Examples](#🎆-api-examples)\n      - [Parameters in path](docs/param_in_path.md)\n      - [Query string parameters](docs/query_param.md)\n      - [Post Form](docs/post_form.md)\n      - [Header](docs/header.md)\n      - [Send File](docs/send_file.md)\n      - [Save File](docs/save_file.md)\n      - [Upload Files](docs/upload_file.md)\n      - [Json](docs/json.md)\n      - [Computing Handler](docs/compute_handler.md)\n      - [Series Handler](docs/series_handler.md)\n      - [Compression](docs/compress.md)\n      - [BluePrint](docs/blueprint.md)\n      - [Serving static files](docs/serving_static_file.md)\n      - [Cookie](docs/cookie.md)\n      - [Custom Server Configuration](docs/config.md)\n      - [Aspect-oriented programming](docs/aop.md)\n      - [Https Server](docs/https.md)\n      - [Proxy](docs/proxy.md)\n      - [MySQL](docs/mysql.md)\n      - [Redis](docs/redis.md)\n      - [Timer](docs/timer.md)\n      - [Server Push(Server sent event)](docs/server_push.md)\n      - [Redirect](docs/redirect.md)\n    - [Built-in Json Api](docs/json_api.md)\n\n## Dicssussion\n\nFor more information, you can first see discussions:\n\n**https://github.com/wfrest/wfrest/discussions**\n\n## Build\n\n### Requirement\n\n* workflow, version v0.9.9 or newer\n* Linux , like ubuntu 16.04 or newer\n* Cmake or Xmake\n* zlib1g-dev\n* libssl-dev\n* libgtest-dev\n* gcc and g++ or llvm + clang, tested with ubuntu 20.04\n\nTips : Because in g++ 4.9 and the previous version, lambda can't capture variadic templates, we require you to upgrade your g++ version to 5.0 and above.\n\nIf you are on ubuntu 20.04, you may install them by command:\n\n```bash\napt-get install build-essential cmake zlib1g-dev libssl-dev libgtest-dev -y\n```\n\nFor more details, you can see here : [requirement details](docs/requirement.md)\n\n### Cmake\n\n```\ngit clone --recursive https://github.com/wfrest/wfrest\ncd wfrest\nmake\nsudo make install\n```\n\nFor test :\n\n```\nmake check\n```\n\nFor example :\n\n```\nmake example\n```\n\n### Xmake\n\nIf you want to use xmake to build wfrest, you can see [xmake build document](docs/xmake.md)\n\n### Docker\n\nUse dockerfile, the Dockerfile locate `/docker` subdirectory of  root source code repository.\n\n```\ndocker build -t wfrest ./docker/ubuntu/\n```\n\nIf you are using `podman`, you can also build it. and tested under ubuntu 20.04\n\n```\npodman build -t wfrest ./docker/ubuntu/\n```\n\nOr you can Pull from DockerHub\n\n```\ndocker pull wfrest/wfrest\n```\n\n## Quick start\n\n```cpp\n#include \"wfrest/HttpServer.h\"\nusing namespace wfrest;\n\nint main()\n{\n    HttpServer svr;\n\n    // curl -v http://ip:port/hello\n    svr.GET(\"/hello\", [](const HttpReq *req, HttpResp *resp)\n    {\n        resp-\u003eString(\"world\\n\");\n    });\n    // curl -v http://ip:port/data\n    svr.GET(\"/data\", [](const HttpReq *req, HttpResp *resp)\n    {\n        std::string str = \"Hello world\";\n        resp-\u003eString(std::move(str));\n    });\n\n    // curl -v http://ip:port/post -d 'post hello world'\n    svr.POST(\"/post\", [](const HttpReq *req, HttpResp *resp)\n    {\n        // reference, no copy here\n        std::string\u0026 body = req-\u003ebody();\n        fprintf(stderr, \"post data : %s\\n\", body.c_str());\n    });\n\n    if (svr.start(8888) == 0)\n    {\n        getchar();\n        svr.stop();\n    } else\n    {\n        fprintf(stderr, \"Cannot start server\");\n        exit(1);\n    }\n    return 0;\n}\n```\n\n","funding_links":[],"categories":["Web Application Framework","Rest protocol","Program"],"sub_categories":["C/C++"],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fwfrest%2Fwfrest","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fwfrest%2Fwfrest","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fwfrest%2Fwfrest/lists"}