$ make
$ ./webserver ./demo/config.conf
List of Handlers:
- EchoHandler - /echo
- StaticHandler - /static/
- StatusHandler - /status
- NotFoundHandler - any uri not included above
$ sudo apt-get install python-pip
$ sudo pip install psutil
$ python test.py
- Create your handler hpp and cpp files
- Add your Handler configuration in the config.conf file
- You can add any special behavior with other Handlers in connection.cpp, where the handle_read method will control which Handler to use.
Our main.cpp instantiates a Server object, which takes in a ServerConfig object, as well as the host address. The Server then creates a map of pointers to Handlers as per the ServerConfig instructions, which are based off of demo.config.conf.
A connection manager is used to manage multiple connections to server. Each connection is responsible for determining the Handler type it needs to invoke in order to display the information requested. The request and response classes are designed solely to parse and provide information for the connection class to manage.
http://www.boost.org/doc/libs/1_57_0/doc/html/boost_asio/examples/cpp03_examples.html
http://stackoverflow.com/questions/33282703/running-http-server-example-from-boost-asio