changed direct backend access

This commit is contained in:
Carsten Graf
2025-06-13 23:11:58 +02:00
parent b6fa2d69e7
commit abedcc8fb1
5 changed files with 58 additions and 30 deletions

View File

@@ -5,9 +5,13 @@
const char* BACKEND_SERVER = "http://db.reptilfpv.de:3000";
const char* BACKEND_TOKEN = "a4514dc0-15f5-4299-8826-fffb3139d39c";
String BACKEND_TOKEN = licence; // Use the licence as the token for authentication
bool backendOnline() {
Serial.println(licence);
if (WiFi.status() != WL_CONNECTED) {
Serial.println("No WiFi connection.");
return false;

View File

@@ -287,6 +287,7 @@ void setup() {
loadBestTimes();
loadSettings();
loadWifiSettings();
loadLocationSettings();
setupWifi(); // WiFi initialisieren
setupOTA(&server);

View File

@@ -240,6 +240,7 @@ server.on("/api/set-location", HTTP_POST, [](AsyncWebServerRequest *request) {
server.on("/api/get-location", HTTP_GET, [](AsyncWebServerRequest *request){
DynamicJsonDocument doc(128);
loadLocationSettings();
doc["locationid"] = masterlocation ? masterlocation : "";
String result;
serializeJson(doc, result);