web: only include web printer when needed

This commit is contained in:
Maxim Prokhorov
2023-04-13 18:00:12 +03:00
parent ffd23d095b
commit ea6eb52deb
3 changed files with 13 additions and 17 deletions

View File

@@ -13,15 +13,10 @@ Copyright (C) 2020-2021 by Maxim Prokhorov <prokhorov dot max at outlook dot com
#include <functional>
#include "api_path.h"
#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*);
#include "api_path.h"
#include "api_impl.h"
namespace espurna {
namespace api {
@@ -32,6 +27,10 @@ using JsonHandler = std::function<bool(Request&, JsonObject& reponse)>;
} // namespace api
} // namespace espurna
using ApiRequest = espurna::api::Request;
using ApiBasicHandler = espurna::api::BasicHandler;
using ApiJsonHandler = espurna::api::JsonHandler;
void apiRegister(String path,
espurna::api::BasicHandler&& get,
espurna::api::BasicHandler&& put);
@@ -42,11 +41,10 @@ void apiRegister(String path,
bool apiError(espurna::api::Request&);
bool apiOk(espurna::api::Request&);
#endif
using ApiRequest = espurna::api::Request;
using ApiBasicHandler = espurna::api::BasicHandler;
using ApiJsonHandler = espurna::api::JsonHandler;
bool apiAuthenticateHeader(AsyncWebServerRequest*, const String& key);
bool apiAuthenticateParam(AsyncWebServerRequest*, const String& key);
bool apiAuthenticate(AsyncWebServerRequest*);
void apiCommonSetup();
bool apiEnabled();

View File

@@ -25,8 +25,6 @@ Copyright (C) 2020-2022 by Maxim Prokhorov <prokhorov dot max at outlook dot com
#include "libs/PrintString.h"
#include "web_print.ipp"
#include <algorithm>
#include <utility>
@@ -38,6 +36,10 @@ Copyright (C) 2020-2022 by Maxim Prokhorov <prokhorov dot max at outlook dot com
extern "C" uint32_t _FS_start;
extern "C" uint32_t _FS_end;
#if WEB_SUPPORT
#include "web_print.ipp"
#endif
namespace espurna {
namespace terminal {
namespace {

View File

@@ -10,8 +10,6 @@ Copyright (C) 2016-2019 by Xose Pérez <xose dot perez at gmail dot com>
#include "espurna.h"
#if WEB_SUPPORT
#include <ESPAsyncWebServer.h>
#include <functional>
@@ -36,5 +34,3 @@ void webRequestRegister(web_request_callback_f);
uint16_t webPort();
void webSetup();
#endif // WEB_SUPPORT == 1