/* API MODULE Copyright (C) 2016-2019 by Xose PĂ©rez */ #pragma once #include "espurna.h" #include "web.h" #if WEB_SUPPORT bool apiAuthenticateHeader(AsyncWebServerRequest*, const String& key); bool apiAuthenticateParam(AsyncWebServerRequest*, const String& key); bool apiAuthenticate(AsyncWebServerRequest*); void apiCommonSetup(); bool apiEnabled(); bool apiRestFul(); String apiKey(); #endif // WEB_SUPPORT == 1 #if WEB_SUPPORT && API_SUPPORT #include "api_impl.h" #include using ApiBasicHandler = std::function; using ApiJsonHandler = std::function; void apiRegister(const String& path, ApiBasicHandler&& get, ApiBasicHandler&& put); void apiRegister(const String& path, ApiJsonHandler&& get, ApiJsonHandler&& put); void apiSetup(); bool apiError(ApiRequest&); bool apiOk(ApiRequest&); #endif // API_SUPPORT == 1