Chat freely about anything...

User avatar
By Sprite_tm
#9841
sfranzyshen wrote:I simply want to add the ability to serve up (httpd) a single gzip html file from within the IoT_Demo structure. Not create a full blown httpd server. I simply do not need it!

Well, the problem is that there's only a very small difference between what you need and a full-blown webserver, actually. If you want to support most/all webbrowsers and methods, including concurrent accesses and everything else that's needed to make stuff work, it quickly grows to basically a full-blown webserver.
I don't have to do this at all. I have the client html file ... that I can redistribute in many ways (internet, usb, floopy) requiring the client side to get the file. I can also use the curl utility to make changes to the esp8266 ... without a web browser at all. I can use other platforms and other development environments simutaniously to access the device (think web app & android native app ... at the same time) ... again, without a "full blown web server environment" nor a web browser. I can also do all this ... behind a SSL connection.

can esphttpd do that?

Absolutely. Define CGIs that take/send JSON data (or just GET/POST parameters), write a nice app in html/js/whatever and let it all interact. You can also use curl or a real app to interact with the thing. Esphttpd doesn't support ssl yet, but that's a tiny change I just haven't done yet because I don't need it myself and haven't heard any requests for as of yet.

Also, you seem to be pretty fixed on the fact that esphttpd uses a filesystem by default. It doesn't have to: if you define your data by writing cgi-like functions that return that data, you can disable the filesystem all together. It's made to be modular and can be made to be pretty tiny, as bjpirt mentioned.

Don't get me wrong - if you want to write a webserver custom-tailored to what you want, I won't stop you, and I wish you all the best in your endeavour. I just want to correct the idea that esphttpd is more bloated than it needs to be.