Open zafrirron opened 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).
Does your handleROOT add a proper prefix to the filename, f.i. '/spiffs/hello' or 'sdcard/hello' so that an actual filesystem is searched?
creating the following handler definition:
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).