Make this bih multithreaded
This commit is contained in:
32
routes.h
32
routes.h
@ -1,13 +1,33 @@
|
||||
#ifndef ROUTES_H_
|
||||
#define ROUTES_H_
|
||||
|
||||
#include "gebs/gebs.h"
|
||||
#include "mongoose/mongoose.h"
|
||||
|
||||
void route_page_not_found(struct mg_connection *conn, struct mg_http_message *msg);
|
||||
void route_simple_css(struct mg_connection *conn, struct mg_http_message *msg);
|
||||
void route_favicon(struct mg_connection *conn, struct mg_http_message *msg);
|
||||
void route_hotreload_js(struct mg_connection *conn, struct mg_http_message *msg);
|
||||
void route_home(struct mg_connection *conn, struct mg_http_message *msg);
|
||||
void route_build_id(struct mg_connection *conn, struct mg_http_message *msg);
|
||||
typedef struct {
|
||||
int status_code;
|
||||
NString_List headers;
|
||||
String_Builder body;
|
||||
} Route_Result;
|
||||
|
||||
typedef struct {
|
||||
struct mg_mgr *mgr;
|
||||
ulong conn_id;
|
||||
struct mg_str message;
|
||||
} Route_Thread_Data;
|
||||
|
||||
typedef void (*Route_Handler)(struct mg_http_message *msg, Route_Result *result);
|
||||
|
||||
typedef struct {
|
||||
char *key; // path
|
||||
Route_Handler value;
|
||||
} Route;
|
||||
|
||||
void route_page_not_found(struct mg_http_message *msg, Route_Result *result);
|
||||
void route_simple_css(struct mg_http_message *msg, Route_Result *result);
|
||||
void route_favicon(struct mg_http_message *msg, Route_Result *result);
|
||||
void route_hotreload_js(struct mg_http_message *msg, Route_Result *result);
|
||||
void route_home(struct mg_http_message *msg, Route_Result *result);
|
||||
void route_build_id(struct mg_http_message *msg, Route_Result *result);
|
||||
|
||||
#endif // ROUTES_H_
|
||||
|
Reference in New Issue
Block a user