diff options
Diffstat (limited to 'httpd.cpp')
-rw-r--r-- | httpd.cpp | 7 |
1 files changed, 7 insertions, 0 deletions
@@ -84,6 +84,13 @@ int httpd::req_handler(void * cls, MHD_add_response_header(rsp, "ETag", sHtmlCssEtag); MHD_add_response_header(rsp, "Content-Type", "text/css; charset=utf-8"); } + else if(strcasecmp(url, "/api.json") == 0) + { + executor::inst()->get_http_report(EV_HTML_JSON, str); + + rsp = MHD_create_response_from_buffer(str.size(), (void*)str.c_str(), MHD_RESPMEM_MUST_COPY); + MHD_add_response_header(rsp, "Content-Type", "application/json; charset=utf-8"); + } else if(strcasecmp(url, "/h") == 0 || strcasecmp(url, "/hashrate") == 0) { executor::inst()->get_http_report(EV_HTML_HASHRATE, str); |