Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/mattn/clask
Web micro-framework like flask in C++.
https://github.com/mattn/clask
cpp micro-framework
Last synced: 8 days ago
JSON representation
Web micro-framework like flask in C++.
- Host: GitHub
- URL: https://github.com/mattn/clask
- Owner: mattn
- License: mit
- Created: 2020-06-07T12:45:08.000Z (over 4 years ago)
- Default Branch: master
- Last Pushed: 2024-01-28T12:55:22.000Z (10 months ago)
- Last Synced: 2024-10-23T06:09:24.133Z (16 days ago)
- Topics: cpp, micro-framework
- Language: C++
- Homepage:
- Size: 671 KB
- Stars: 124
- Watchers: 12
- Forks: 7
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# clask
![C/C++ CI](https://github.com/mattn/clask/workflows/C/C++%20CI/badge.svg)
Very Very Experimental Web micro-framework like flask in C++.
*DO NOT USE THIS IN PRODUCTION*
## Usage
```cpp
#include "clask/core.hpp"int main() {
auto s = clask::server();
s.GET("/", [](clask::request& req) {
return "OK!";
});
s.GET("/foo", [](clask::response& resp, clask::request& req) {
resp.set_header("content-type", "text/html");
resp.write("hello");
});
s.run();
}
```## TODO
* ~~Unescape paths in request~~
* ~~Unescape query parameters in request~~
* ~~Implement keep-alive~~
* ~~Serve static file~~
* Responses oriented classes such as JSON## License
MIT
This product contains following third-party libraries:
* picohttpparser written by kazuho
## Author
Yasuhiro Matsumoto (a.k.a. mattn)