nkolban / esp32-snippets

Sample ESP32 snippets and code fragments
https://leanpub.com/kolban-ESP32
Apache License 2.0
2.34k stars 711 forks source link

WebServer serving issue #417

Open zafrirron opened 6 years ago

zafrirron commented 6 years ago

creating the following handler definition:

HttpServer* pHttpServer = new HttpServer();
std::regex ppath("\\/hello.*");
pHttpServer->addPathHandler("GET",   &ppath,                       handleROOT);

will result correct handling & serving by the handler, monitor however shows:

I (33489) HtttpResponse: Opening file: /hello E (33490) HttpResponse: Unable to open file /hello for reading

means although the handler was found and processed, the server tries to get the file from file system (should happen only if handler was not found).

HanVertegaal commented 6 years ago

Does your handleROOT add a proper prefix to the filename, f.i. '/spiffs/hello' or 'sdcard/hello' so that an actual filesystem is searched?