summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMarc Lasch <mlasch@mailbox.org>2015-08-13 14:25:34 +0200
committerMarc Lasch <mlasch@mailbox.org>2015-08-13 14:25:34 +0200
commitd5a5fd5560198cf219c0b7f30e7ddb2b7b2443e1 (patch)
treeacbde47c1a0c5aa1e309fcecafebf2eabeb12141
parent213bd5dbfdf4c35aba623c15e31af432a3d1a137 (diff)
downloadnetgraph-master.tar.gz
netgraph-master.zip
-rw-r--r--src/apiHandler.cpp9
1 files changed, 6 insertions, 3 deletions
diff --git a/src/apiHandler.cpp b/src/apiHandler.cpp
index 231fd6c..a291867 100644
--- a/src/apiHandler.cpp
+++ b/src/apiHandler.cpp
@@ -9,7 +9,10 @@ apiHandler::apiHandler(struct mg_connection *conn) {
apiHandler::~apiHandler(void) { }
int apiHandler::processRequest(void) {
-
- return MG_FALSE;
-
+ regex pattern {"^/api"};
+ if (regex_match(MyConnection->uri, pattern)) {
+ mg_printf_data(MyConnection, "{json: true}");
+ return MG_TRUE;
+ } else
+ return MG_FALSE;
}