diff --git a/code/espurna/api.cpp b/code/espurna/api.cpp index 91a14b8b..3a2e889c 100644 --- a/code/espurna/api.cpp +++ b/code/espurna/api.cpp @@ -193,6 +193,8 @@ error: return false; } +#if WEB_SUPPORT + String ApiRequest::wildcard(int index) const { if (index < 0) { index = std::abs(index + 1); @@ -230,6 +232,8 @@ size_t ApiRequest::wildcards() const { return result; } +#endif + // ----------------------------------------------------------------------------- #if API_SUPPORT diff --git a/code/espurna/api.h b/code/espurna/api.h index 2b12e5b6..ace0edcb 100644 --- a/code/espurna/api.h +++ b/code/espurna/api.h @@ -11,12 +11,13 @@ Copyright (C) 2020-2021 by Maxim Prokhorov #if WEB_SUPPORT +#include "api_impl.h" +#include "web.h" + bool apiAuthenticateHeader(AsyncWebServerRequest*, const String& key); bool apiAuthenticateParam(AsyncWebServerRequest*, const String& key); bool apiAuthenticate(AsyncWebServerRequest*); @@ -33,9 +34,9 @@ using ApiJsonHandler = std::function; void apiRegister(const String& path, ApiBasicHandler&& get, ApiBasicHandler&& put); void apiRegister(const String& path, ApiJsonHandler&& get, ApiJsonHandler&& put); -#endif - -void apiSetup(); bool apiError(ApiRequest&); bool apiOk(ApiRequest&); +#endif + +void apiSetup(); diff --git a/code/espurna/ota_basicweb.cpp b/code/espurna/ota_basicweb.cpp index e79b4a26..9a73cb17 100644 --- a/code/espurna/ota_basicweb.cpp +++ b/code/espurna/ota_basicweb.cpp @@ -19,6 +19,7 @@ Copyright (C) 2019-2021 by Maxim Prokhorov +#include namespace ota { namespace basic_web {