ESPAsyncWebserver basic ArduinoJSON handler example
server.on("/api/test", HTTP_GET, [](AsyncWebServerRequest *request) {
// Respond with JSON {"status": "ok"}
AsyncResponseStream *response = request->beginResponseStream("application/json");
DynamicJsonDocument json(1024);
json["status"] = "ok";
serializeJson(json, *response);
request->send(response);
});