|
esp8266_web_settings beta
|
This class provides a REST API for the attached devices. More...
#include <grmcdorman/device/WebServerRestAPI.h>
Public Member Functions | |
| void | setup (AsyncWebServer &server, const std::vector< Device * > &devices) |
| Set up with the web server. More... | |
This class provides a REST API for the attached devices.
This leverages the Definitions list in the Devices to create the API end points, and the publish method to serve requests.
| void grmcdorman::device::WebServerRestApi::setup | ( | AsyncWebServer & | server, |
| const std::vector< Device * > & | devices | ||
| ) |
Set up with the web server.
This must be called after the devices have been added. The URIs for the devices, and the device list URI, will be registered with the server.
The URIs added are:
/rest/devices/get to return all devices/rest/device/_device-id_/get to return values for one device| server | Web server to install API on. |
| devices | List of devices to install end-points for. A reference is held to this; this list must exist for the lifetime of this object. |