Using ESP32 as static web server, you can have a closer look at server.h for ESP32 server.
You need to install ESP32 SPIFFS Uploader for uploading static data to ESP32 SPIFFS system.
You may need to install needed libraries in libraries folder.
#include <AsyncTCP.h>
#include <ESPAsyncWebServer.h>
I'm using my another astro project which generated static files for serving.
AsyncWebServer server(80);
// handle OPTIONS and 404 request
void handleNotFound(AsyncWebServerRequest* request) {
...
}
void setupServer() {
...
server.serveStatic("/", SPIFFS, "/");
server.onNotFound(handleNotFound);
server.begin();
}
You can even using esp32 as template processing engine, you can have a look on it github page: