- Device dropdown: All devices, this device by name, then drivers found by mDNS (tagged app=led-strip) and any added by hand. - POST /api/relay: a driver calls another driver's API for the page, so the browser only talks to its own board. Limited to /api/*, /ota and /reboot. - All devices sends brightness and preset plays to every device. - Settings: sync this device's presets, order and startup to the others. - CORS for LAN and localhost origins, and an OPTIONS handler for /ota. - Header labels are removed; the controls keep aria-labels. Co-Authored-By: Claude Haiku 5.5 <noreply@anthropic.com>
25 lines
523 B
C
25 lines
523 B
C
/*
|
|
* SPDX-License-Identifier: Apache-2.0
|
|
*/
|
|
#pragma once
|
|
|
|
#include "esp_err.h"
|
|
#include "esp_http_server.h"
|
|
|
|
#ifdef __cplusplus
|
|
extern "C" {
|
|
#endif
|
|
|
|
/** @brief Start the HTTP server on port 80 (UI and JSON API). */
|
|
esp_err_t web_start(void);
|
|
|
|
/**
|
|
* @brief Add Access-Control-Allow-Origin for a LAN or localhost page that asked (the Origin header).
|
|
* Call before the response is sent. Other origins get no header, so the browser blocks them.
|
|
*/
|
|
void web_allow_lan_origin(httpd_req_t *req);
|
|
|
|
#ifdef __cplusplus
|
|
}
|
|
#endif
|