[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

View file

@ -1,9 +1,37 @@
#include <Cytoplasm/HttpServer.h>
#include <Cytoplasm/Log.h>
#include <string.h>
#include <Parsee.h>
int
Main(void)
{
HttpServer *server = NULL;
HttpServerConfig conf;
ParseeData *data;
const ParseeConfig *parseeConf;
Log(LOG_INFO, "%s - v%s", NAME, VERSION);
ParseeConfigInit();
ParseeExportConfigYAML(StreamStdout());
parseeConf = ParseeConfigGet();
memset(&conf, 0, sizeof(conf));
conf.port = parseeConf->port;
conf.threads = 4;
conf.maxConnections = 32;
conf.handlerArgs = ParseeInitData();
conf.handler = ParseeRequest;
/* TODO: The rest of Parsee. */
server = HttpServerCreate(&conf);
HttpServerStart(server);
HttpServerJoin(server);
HttpServerFree(server);
ParseeConfigFree();
return 0;
}