Served

A C++11 library for quickly building RESTful web servers. CODE DOCS E.G. CODE DOCS E.G. Served was designed primarily to create RESTful C++ web services with ease and simplicity. To demonstrate, here's an example hello world application: # include <served/served.hpp> int main ( int argc, char const * argv[]) { // Create a multiplexer for handling requests served::multiplexer mux; // GET /hello mux.handle( "/hello" ) .get([](served::response & res, const served::request & req) { res << "Hello world!" ; }); // Create the server and run with 10 handler threads. served::net:: server server ("127.0.0.1", "8080", mux) ; server.run( 10 ); return (EXIT_SUCCESS); } $ curl http://localhost:8080/hello Hello world! Served supports URL parameters for easy RESTification. mux.handle( "/users/{id}" ) .get([](served::response & res, ...

Linked on 2015-01-27 03:49:08 | Similar Links