jf-framework
Loading...
Searching...
No Matches
router.h
Go to the documentation of this file.
1
6
7
#ifndef JF_FRAMEWORK_ROUTER_H
8
#define JF_FRAMEWOR_ROUTER_H
9
10
#include <
http.h
>
11
#include <stdint.h>
12
13
#define MAX_ROUTES 128
14
15
typedef
void (*route_handler_t)(
const
HttpRequest
* request,
HttpResponse
* response);
16
17
typedef
struct
{
18
char
method[8];
19
char
path[256];
20
route_handler_t handler;
21
}
Route
;
22
23
uint32_t
jf_RouterAdd
(
const
char
* method,
const
char
* path,
const
char
* router, route_handler_t handler);
24
void
jf_CreateRouter
(
void
);
25
26
#endif
http.h
jf_CreateRouter
void jf_CreateRouter(void)
Definition
router.c:43
jf_RouterAdd
uint32_t jf_RouterAdd(const char *method, const char *path, const char *router, route_handler_t handler)
Definition
router.c:19
HttpRequest
Definition
http.h:14
HttpResponse
Definition
http.h:36
Route
Definition
router.h:17
include
router.h
Generated by
1.16.1