|
rest-cpp
REST-like framework and server for blazing fast web applications in C++11
|
REST-like framework and server for blazing fast web applications in C++11.
$ rest-cpp new blog $ cd blog $ rest-cpp server
Navigate your browser to http://127.0.0.1:8080 now.
On OS X Commanand Line Tools are required; on Linux gcc-4.8 or newer is required. Not tested on other platforms.
Build library using make on root directory.
Run make install on project folder - it will build the library and copy headers, shared library and generator to /usr/local.
After bulding the Library, go to example/todo_server and use make.
You may build your own apps from scratch, but you can just #include <rest/rest.h> and use simplified workflow. To make it even easier, you can use rest-cpp utility to do some work for you.
rest-cpp allows you to create and manage app. It is installed to /usr/local/bin and requires Python in version at least 2.5 (which probably you have already installed).
Use rest-cpp new [directory] to create new application. directory isn't required, app will be created in current directory if omitted.
Created are two files:
init.cpp with basic "hello world"Makefile with build commandsExisting files are skipped, to update file to new version, just remove previous one.
Available tasks:
make server - default action, build and start servermake build - build serverAvailable options:
address=ip_or_host - address for server to bind, default: 0.0.0.0port=number - port to listen, default: 8080 (ports lower than 1024 may require superuser privileges)workers=number - number of workers, default: 4dispatcher=lc/rr - workers dispatcher algorithm - lc for LeastConnections, rr for RoundRobin, default: lcTo use options pass them to make, i.e. make server workers=2 port=9000. Options are complitation-time, not runtime - this means, to i.e. change port, you must pass port to make during building process.
*rest-cpp wraps make, so you can use rest-cpp build and rest-cpp server instead of make (you can use the same options as above).*
lorem ipsum
lorem ipsum
Made with love, inspired by put.poznan.pl