Might add HTTPS support, and a simple client. Added namespace and some restructuring preparing for HTTPS especially.

This commit is contained in:
eidheim 2014-07-10 19:26:34 +02:00
commit 4f5522adb9
4 changed files with 175 additions and 183 deletions

View file

@ -1,16 +1,17 @@
#include "httpserver.hpp"
#include "server.hpp"
//Added for the json-example:
#include <boost/property_tree/ptree.hpp>
#include <boost/property_tree/json_parser.hpp>
using namespace std;
using namespace SimpleWeb;
//Added for the json-example:
using namespace boost::property_tree;
int main() {
//HTTP-server at port 8080 using 4 threads
HTTPServer httpserver(8080, 4);
Server<HTTP> httpserver(8080, 4);
//Add resources using regular expression for path, a method-string, and an anonymous function
//POST-example for the path /string, responds the posted string