MCPcopy Create free account
hub / github.com/FastLED/FastLED / main

Function main

tests/fl/stl/asio/http/server.cpp:8–29  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

6#include "fl/log/log.h"
7
8int main() {
9#ifdef FASTLED_HAS_NETWORKING
10 fl::HttpServer server;
11
12 // Test route registration
13 server.get("/test", [](const fl::http_request& req) {
14 return fl::http_response::ok("test response");
15 });
16
17 server.post("/data", [](const fl::http_request& req) {
18 fl::json response = fl::json::object();
19 response.set("status", "ok");
20 return fl::http_response::ok().json(response);
21 });
22
23 FL_WARN("HTTP server API test passed");
24#else
25 FL_WARN("Networking not available - test skipped");
26#endif
27
28 return 0;
29}

Callers

nothing calls this directly

Calls 4

postMethod · 0.80
getMethod · 0.45
setMethod · 0.45
jsonMethod · 0.45

Tested by

no test coverage detected