bkeevil / esp32-cam

A webcam firmware for ESP32 based camera modules
149 stars 43 forks source link

Different name of the CSS stylesheet referenced in the index.html #14

Closed karlitos closed 4 years ago

karlitos commented 4 years ago

In the index.html page, the stylesheet is referenced as stylesheet.css

<link rel="stylesheet" type="text/css" href="stylesheet.css" media="screen" />

but the name of the stylesheet is style.css. This is confusing and also breaks the support of the IDEs. Renaming the stylesheet reference to style.css results in unstyled webpage.

So, somewhere along the process of building the app, the stylesheet is renamed to stylesheet.css

  1. Is there a reason for this ?
  2. Is this really necessary ?
karlitos commented 4 years ago

It turned out the "fix" can be quite easy. In the app_httpd.c change the httpd_uri_t stylesheet_uri to:

 httpd_uri_t stylesheet_uri = {
        .uri       = "/style.css",
        .method    = HTTP_GET,
        .handler   = stylesheet_handler,
        .user_ctx  = NULL
    };

For someone, who does Web-Development as me it is really confusing when the HMTL references non-existing stylesheet.

bkeevil commented 4 years ago

This was inherited from the original ESP-WHO demo app that the project was forked from. I am not aware of any reasons why it was done this way. Go ahead and fix.

bkeevil commented 4 years ago

Merged. Thank you for your contribution karlitos