need help on esp32 server hosting an application consisting of several html files
Posted: Sun Jan 01, 2023 11:23 pm
I am working on a remote control project for an electrical installation with the ESP32 card (Espressif). But here I have trouble understanding and determining how the component files of my web application can be sent to the client when the latter connects.
In almost all the tutorials that I had to follow, the application is made up of three files, one for the html, one for the CSS style and another for the script.
For my case, I have three html files (one page for home window, one for sensor data and another for electrical equipment management), one CSS file and another JS script file; so I would like to offer the client the ability to navigate between these pages.
From there, the questions I ask myself are those of knowing how will be the flow of files between the client and the ESP32 server?
How to send these files to the client when it requests the connection?
I tried to answer myself, so I said to myself this:
in the first case, you just have to send the home page, the CSS file and the script file first. But again I wonder how the server will then know how to send another file when you click on a link in the menu?
in the second case, I said to myself that it is necessary to send all three html files at the same time, as well as the CSS and Script JS files. Again I wonder how the client will display the correct file?
please answer me please
In almost all the tutorials that I had to follow, the application is made up of three files, one for the html, one for the CSS style and another for the script.
For my case, I have three html files (one page for home window, one for sensor data and another for electrical equipment management), one CSS file and another JS script file; so I would like to offer the client the ability to navigate between these pages.
From there, the questions I ask myself are those of knowing how will be the flow of files between the client and the ESP32 server?
How to send these files to the client when it requests the connection?
I tried to answer myself, so I said to myself this:
in the first case, you just have to send the home page, the CSS file and the script file first. But again I wonder how the server will then know how to send another file when you click on a link in the menu?
in the second case, I said to myself that it is necessary to send all three html files at the same time, as well as the CSS and Script JS files. Again I wonder how the client will display the correct file?
please answer me please