blob: a2918672614b1390c71a4fadbd60961d34370cd4 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
|
#include "apiHandler.h"
using namespace std;
apiHandler::apiHandler(struct mg_connection *conn) {
MyConnection = conn;
}
apiHandler::~apiHandler(void) { }
int apiHandler::processRequest(void) {
regex pattern {"^/api"};
if (regex_match(MyConnection->uri, pattern)) {
mg_printf_data(MyConnection, "{json: true}");
return MG_TRUE;
} else
return MG_FALSE;
}
|