[ADD/WIP] Routerwerk!

This commit is contained in:
LDA 2024-06-12 23:27:36 +02:00
commit 47c98cbbe3
8 changed files with 280 additions and 1 deletions

30
src/Routes/Root.c Normal file
View file

@ -0,0 +1,30 @@
#include <Routes.h>
RouteHead(RouteRoot, arr, argp)
{
ParseeHttpArg *args = argp;
HttpResponseHeader(args->ctx, "Content-Type", "text/html");
HttpSendHeaders(args->ctx);
StreamPrintf(args->stream, "<html lang=\"en\">");
StreamPrintf(args->stream, " <head>");
StreamPrintf(args->stream, " <title>Parsee Lander</title>");
StreamPrintf(args->stream, " </head>");
StreamPrintf(args->stream, " <body>");
StreamPrintf(args->stream, " <center><h1>");
StreamPrintf(args->stream, " Your Parsee is running!");
StreamPrintf(args->stream, " </h1></center>");
StreamPrintf(args->stream, " <hr/>");
StreamPrintf(args->stream, " <p>");
StreamPrintf(args->stream, " Kinda jealous of that, to be ");
StreamPrintf(args->stream, " fair.");
StreamPrintf(args->stream, " </p>");
StreamPrintf(args->stream, " <p>");
StreamPrintf(args->stream, " Your homeserver now can interact");
StreamPrintf(args->stream, " with the bridge, with the ");
StreamPrintf(args->stream, " generated YAML file.");
StreamPrintf(args->stream, " </p>");
StreamPrintf(args->stream, " </body>");
StreamPrintf(args->stream, "</html>");
return NULL;
}