mirror of
https://github.com/richonguzman/LoRa_APRS_iGate.git
synced 2026-01-22 00:30:16 +01:00
primera prueba ok
This commit is contained in:
parent
44c94d454b
commit
dbb717eb47
|
|
@ -16,6 +16,10 @@
|
|||
#include "display.h"
|
||||
#include "utils.h"
|
||||
|
||||
//
|
||||
#include "web_utils.h"
|
||||
//
|
||||
|
||||
|
||||
AsyncWebServer server(80);
|
||||
|
||||
|
|
@ -44,10 +48,7 @@ extern String versionDate;
|
|||
extern uint32_t lastWiFiCheck;
|
||||
extern bool WiFiConnect;
|
||||
|
||||
//
|
||||
const char* htmlPage1 = "<html><body><h1>Page 1</h1></body></html>";
|
||||
const char* htmlPage2 = "<html><body><h1>Page 2</h1></body></html>";
|
||||
//
|
||||
|
||||
|
||||
namespace Utils {
|
||||
|
||||
|
|
@ -273,11 +274,16 @@ void startOTAServer() {
|
|||
});
|
||||
|
||||
server.on("/test1", HTTP_GET, [](AsyncWebServerRequest *request) {
|
||||
request->send(200, "text/plain", htmlPage1 );
|
||||
request->send(200, "text/html", htmlPage1);
|
||||
});
|
||||
|
||||
server.on("/test2", HTTP_GET, [](AsyncWebServerRequest *request) {
|
||||
request->send(200, "text/plain", htmlPage2 );
|
||||
String dynamicContent = String(htmlPage3);
|
||||
dynamicContent.replace("%VCALLSIGN%", Config.callsign);
|
||||
|
||||
|
||||
|
||||
request->send(200, "text/html", dynamicContent);
|
||||
});
|
||||
|
||||
AsyncElegantOTA.begin(&server);
|
||||
|
|
|
|||
26
src/web_utils.h
Normal file
26
src/web_utils.h
Normal file
|
|
@ -0,0 +1,26 @@
|
|||
#ifndef WEB_UTILS_H_
|
||||
#define WEB_UTILS_H_
|
||||
|
||||
|
||||
#include "configuration.h"
|
||||
#include <Arduino.h>
|
||||
|
||||
extern Configuration Config;
|
||||
|
||||
//
|
||||
const char* htmlPage1 = "<html><body><h1>Page 1</h1></body></html>";
|
||||
//const char* htmlPage2 = "<html><body><h1>Page 2</h1></body></html>";
|
||||
const char* htmlPage3 = "<!DOCTYPE html><html><head><title>Dynamic Content Example</title></head><body><h1>LoRa iGate Configuration Data</h1><p>Callsign: %VCALLSIGN%</p></body></html>";
|
||||
|
||||
//
|
||||
|
||||
|
||||
namespace WEB_Utils {
|
||||
|
||||
/*void checkWiFi();
|
||||
void startWiFi();
|
||||
void setup();*/
|
||||
|
||||
}
|
||||
|
||||
#endif
|
||||
Loading…
Reference in a new issue