cueOS  2.4
cueOS - Universal Show Control OS for ARM
rest_api.c
1
6#include <string.h>
7#include "http_server.h"
8#include "DMX512_rest_api.h"
9#include "rest_api.h"
10
11
12/***============================================================================================================================
13 * Private functions definitions
14 * These functions are only accessible from within the file's scope
15 *=============================================================================================================================*/
16
22static void _rest_api_router(http_request_s *req){
23#if cueOS_CONFIG_NODETYPE == cueOS_NODETYPE_SLAVE_DMX
25#elif cueOS_CONFIG_NODETYPE == cueOS_NODETYPE_MASTER
26
27#endif
28
29}
30
31
32/***============================================================================================================================
33 * Public functions definitions
34 * These functions can be accessed outside of the file's scope
35 * @see http_request.h for declarations
36 *=============================================================================================================================*/
37
41void rest_api_start(void){
42 http_server_init(REST_API_PORT, _rest_api_router);
43}
http_server_s * http_server_init(uint16_t port, router_fn router)
Initialises a new HTTP server instance.
Definition: http_server.c:256
void DMX512_rest_api_router(http_request_s *req)
Parses the current HTTP request method and URI in order to route requests to a specific api function.
void rest_api_start(void)
Starts API HTTP server on port 8000.
Definition: rest_api.c:41
#define REST_API_PORT
Definition: rest_api.h:12
HTTP request object.
Definition: http_request.h:44