Lightweight C++ HTTP __client and server__ library based on [Asio](https://github.com/chriskohlhoff/asio) for __embedding__ purpose.
Please turn to [doc](doc/) for more tutorials and guides. E.g., [Build Instructions](doc/Build-Instructions.md).
Please turn to [doc](doc/) for more tutorials and guides. E.g., [Build Instructions](doc/Build-Instructions.md) and [Integrate Into Your Project](doc/Integrate-Into-Your-Project.md).
Git repo: https://github.com/sprinfall/webcc. Please check this one instead of the forked for the latest features.
@ -13,15 +13,18 @@ Git repo: https://github.com/sprinfall/webcc. Please check this one instead of t
Every server program has a server object taking a port number (e.g., `8080`) as argument. It listens to this port for incoming connections and requests.
### URL Route
The `Route()` method routes different URLs to different `views`.
Workers are threads which will be waken to process the HTTP requests once they arrive. Theoretically, the more `workers` you have, the more concurrency you gain. In practice, you have to take the number of CPU cores into account and allocate a reasonable number for it.
The `loops` means the number of threads running the IO Context of Asio. Normally, one thread is good enough, but it could be more than that.
### Response Builder
The server API provides a helper class `ResponseBuilder` for the views to chain the parameters and finally build a response object. This is exactly the same strategy as `RequestBuilder`.
### REST Book Server
Suppose you want to create a book server and provide the following operations with RESTful API:
@ -330,7 +385,7 @@ int main(int argc, char* argv[]) {