summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-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;
}