Feb 26, 2015 at 3:10 PM
Edited Feb 27, 2015 at 7:22 AM
I want to create a page (html) that is displaying information about the state of my application, like display running in page until the application ends, and if I connect to the page, I'll see the app's status. I have started from a similar application,
but it is getting more and more complicated. Is there a tutorial for such a thing? I want to refresh the page every some time.
Until now I have managed to do as this:
void handle_put(web::http::http_request message);
void handle_post(web::http::http_request message);
void handle_delete(web::http::http_request message);
Server(utility::string_t url, std::function< void(web::http::http_request) > handler);
and in main I do:
utility::string_t address = U("http://" + server_addr + ":");
// my appli run
There is a global std::unique_ptr<Server> gServer
that is called in the two functions:
void onInit(const utility::string_t& address)
std::function<void(web::http::http_request)> har_func = std::bind(&server::request_handler::handle_a_request, request_handler, std::placeholders::_1);
gServer = std::unique_ptr<Server>(new Server(uri.to_uri().to_string(), har_func));
is getting complicated. In fact there are more handle_a_request
functions that are creating the tables that I have spoken in the beginning, and I am getting lost here... Maybe I don't even need that part.
P.S.: the server::request_handler
is defined in the application (that I have inspired from), is there another simpler way to do it, like some implicit thing from cpprest?