s00500 / ESPUI

A simple web user interface library for ESP32 and ESP8266
https://valencia.lbsfilm.at/midterm-presentation/
Other
923 stars 174 forks source link

ESPUI.server is now declared protected, previously public #234

Closed benreu closed 2 months ago

benreu commented 1 year ago

Describe the bug ESPUI.server is now declared protected, used to be useful with AsynElegantOTA.begin( ESPUI.server )

To Reproduce add this code to reproduce the behavior:

  1. include

  2. AsyncElegantOTA.begin( ESPUI.server );
  3. Open your browser and go to http://IPAddress/update, where IPAddress is your ESP32 IP address. You will get the error: 'AsyncWebServer* ESPUIClass::server' is protected within this context

Expected behavior AsyncElegantOTA used to work seamlessly with ESPUI

Desktop (please complete the following information): All desktops

Smartphone (please complete the following information): All smartphones

Additional info: I moved the ESPUI server variable back to public in the ESPUI.h and everything works as expected. Should I make a Pull Request with this change, or is there something I am overlooking?

s00500 commented 1 year ago

I think we could expose it again, @MartinMueller2003 anything that speaks against that ?

MartinMueller2003 commented 1 year ago

Fixed in PR:

Exposed WebServer, Added password support. #235

benreu commented 1 year ago

Thank you @MartinMueller2003

benreu commented 2 months ago

For anyone coming here with the error of server being private. You should now use:

ESPUI.WebServer()

Examples would be

AsyncElegantOTA.begin( ESPUI.WebServer() ); ESPUI.WebServer()->on( "/upload-config", HTTP_POST ...snip