From d5a5fd5560198cf219c0b7f30e7ddb2b7b2443e1 Mon Sep 17 00:00:00 2001 From: Marc Lasch Date: Thu, 13 Aug 2015 14:25:34 +0200 Subject: blub --- src/apiHandler.cpp | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) (limited to 'src') 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; } -- cgit v1.2.1