Ecosyste.ms: Awesome

An open API service indexing awesome lists of open source software.

Awesome Lists | Featured Topics | Projects

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++.

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)