allow custom-logic json routes

This commit is contained in:
Daniel Zapata
2022-09-11 11:03:17 -05:00
parent 00852704c7
commit 321e4541bb
3 changed files with 87 additions and 48 deletions
+15
View File
@@ -0,0 +1,15 @@
typedef struct {
char* (*routeFnPtr)(int);
char *routename;
} route;
char* state(int a)
{
return "{\"status\":1}";
}
const int routeCount = 1;
route stateR = { .routeFnPtr = &state, .routename = "/state.json"};
const route *routes[routeCount] = {
&stateR
};