Might add HTTPS support, and a simple client. Added namespace and some restructuring preparing for HTTPS especially.
This commit is contained in:
parent
1f4ed9d4a3
commit
4f5522adb9
4 changed files with 175 additions and 183 deletions
5
main.cpp
5
main.cpp
|
|
@ -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
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue