segf-k 1.0
Loading...
Searching...
No Matches
segfk.h
Go to the documentation of this file.
1
10#ifndef _SEG_FK_H_
11#define _SEG_FK_H_
12
14 char *method;
15 char *uri;
16 char *headers;
17 char *body;
18};
19
22 char *headers;
23 char *body;
24};
25
26typedef void (*router_handler)(struct http_request *req, struct http_response *res);
27
32void segfk_run(int port);
33
34// in progress...
36void segfk_add_route(const char *method, const char *path, router_handler handler);
39void segfk_send_response(struct http_response *response);
40
41#endif /* _SEG_FK_H_ */
void segfk_add_route(const char *method, const char *path, router_handler handler)
void(* router_handler)(struct http_request *req, struct http_response *res)
Definition segfk.h:26
void segfk_run(int port)
Starts the minimal HTTP server.
Definition segfk.c:9
struct http_request * segfk_create_request()
void segfk_send_response(struct http_response *response)
struct http_response * segfk_create_response()
void segfk_stop()
char * body
Definition segfk.h:17
char * headers
Definition segfk.h:16
char * method
Definition segfk.h:14
char * uri
Definition segfk.h:15
char * status_code
Definition segfk.h:21
char * body
Definition segfk.h:23
char * headers
Definition segfk.h:22