Centralized the creation of a hostname to a global variable hostname, set in pitrix.cpp. Added an mDNS record for the webserver.

This commit is contained in:
2019-06-14 05:35:17 +02:00
parent 4fdd1d3739
commit 5ce3b0c1b3
5 changed files with 20 additions and 25 deletions

View File

@ -4,6 +4,8 @@
#include "http_server.h"
#include "effects.h"
#include "my_wifi.h"
#include "prototypes.h"
#if defined( ESP8266 )
ESP8266WebServer http_server(HTTP_SERVER_PORT);
@ -71,6 +73,8 @@ void http_server_setup() {
http_server.send_P(400, text_plain, PSTR("Unknown effect."));
});
http_server.begin();
MDNS.addService("_http", "_tcp", 80);
}
void http_server_loop() {