diff options
author | justanothercatgirl <sotov@twistea.su> | 2025-03-27 12:52:11 +0300 |
---|---|---|
committer | justanothercatgirl <sotov@twistea.su> | 2025-03-27 12:52:11 +0300 |
commit | 82742d5d13dc7b0691a79c79f8e62782fcb16e10 (patch) | |
tree | 48d077549ed667d2a54171b82eb7608cb8edaf3e /endpoints.c | |
parent | 8542ec17d3df989f3df9fd03af7a447bf730dc13 (diff) |
Doing SQL (work in progress)
Diffstat (limited to 'endpoints.c')
-rw-r--r-- | endpoints.c | 42 |
1 files changed, 0 insertions, 42 deletions
diff --git a/endpoints.c b/endpoints.c deleted file mode 100644 index 789f48a..0000000 --- a/endpoints.c +++ /dev/null @@ -1,42 +0,0 @@ -#include <stdlib.h> -#include <string.h> - -#include "microhttpd.h" - -#define CONTAINER_IMPLEMENTATION -#define JACSON_IMPLEMENTATION -#include <jacson.h> - -// not accessible in browser because ALL URLs start with / (or with _ in dylib) -char* duplicate(const char* x) { - size_t len = strlen(x); - char* ret = malloc(len+1); - memcpy(ret, x, len); - ret[len] = '\0'; - return ret; -} - -// index, path: / -char* _(struct MHD_Connection* connection) { - const char* resp = "<html><body>This is an index page!</body></html>"; - return duplicate(resp); -} - -// home, path: /home -char* _home(struct MHD_Connection* connection) { - const char* resp = "<html><body>" - "<h1>This is a HOME page!</h1>" - "<div style=\"height:10000px;\"></div>" - "<a href=\"/hidden/hentai\">Don't click me! :0</a>" - "</body></html>"; - return duplicate(resp); -} - -// hentai, path: /hidden/hentai -char* _hidden_hentai(struct MHD_Connection* connection) { - const char* resp = "<html><style>a{text-decoration:none;}</style><body>" - "<p>what did you expect to see...</p>" - "<a href=\"https://pornhub.com\"> </a>" - "</body></html>"; - return duplicate(resp); -} |