mirror of
https://github.com/jwinterm/xmr-stak.git
synced 2026-10-20 06:08:37 +02:00
Merge pull request #213 from fireice-uk/topic-json-api
Initial JSON API implementation
This commit is contained in:
@@ -82,6 +82,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);
|
||||
|
||||
Reference in New Issue
Block a user