Added dynamic pages with dynamic linking during runtime

This commit is contained in:
Nate Choe
2022-02-14 12:08:09 -06:00
parent 8df741a078
commit 6825f12163
28 changed files with 435 additions and 84 deletions

14
example/library.c Normal file
View File

@@ -0,0 +1,14 @@
#include <stdio.h>
#include <string.h>
#include <stdlib.h>
#include <swebs/swebs.h>
int getResponse(Request *request, Response *response) {
char *str = "<h1>Hello world!</h1>";
response->type = BUFFER;
response->response.buffer.data = malloc(30);
strcpy(response->response.buffer.data, str);
response->response.buffer.len = strlen(str);
return 200;
}