mirror of
https://github.com/xoseperez/espurna.git
synced 2026-03-06 16:27:12 +01:00
web: only include web printer when needed
This commit is contained in:
@@ -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();
|
||||
|
||||
@@ -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 {
|
||||
|
||||
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user