Go to the source code of this file.
|
enum | ERROR_CODES { RR_DUPLICATE_ROUTE
, RR_OK
} |
|
|
int | get (char route[], callback_t callback) |
| add an endpoint for a "GET" request at the given endpoint
|
|
int | post (char route[], callback_t callback) |
|
int | register_route (char route[], callback_t callback, node *root_node) |
| adds a route to the URI tree
|
|
int | http_listen (void) |
|
void | setup (void) |
| this needs to be ran before registering any routes.
|
|
◆ http_listen()
◆ register_route()
int register_route |
( |
char | route[], |
|
|
callback_t | callback, |
|
|
node * | root_node ) |
adds a route to the URI tree
- Parameters
-
route | an HTTP verb with a route, separated by a space. (eg. "GET /some/complete/route") |
callback | the function to be ran when a request comes in for the given route |
root_node | the root in which to add this new node, typically either the get root or post root |
- Returns
- one of ERROR_CODES