Added url variables, removed exec pages
This commit is contained in:
@@ -5,7 +5,10 @@
|
||||
#include <swebs/swebs.h>
|
||||
|
||||
int getResponse(Request *request, Response *response) {
|
||||
char *str = request->path;
|
||||
printf("%d\n", request->path.fieldCount);
|
||||
for (int i = 0; i < request->path.fieldCount; i++)
|
||||
printf("%s: %s\n", request->path.fields[i].var.data, request->path.fields[i].value.data);
|
||||
char *str = request->path.path.data;
|
||||
response->type = BUFFER;
|
||||
response->response.buffer.data = malloc(100);
|
||||
strcpy(response->response.buffer.data, str);
|
||||
|
||||
@@ -1,3 +0,0 @@
|
||||
#!/bin/sh
|
||||
|
||||
echo "<p>By the way today's date is $(date)</p>"
|
||||
@@ -3,5 +3,4 @@
|
||||
<h3>It's not very polished but it's certainly a website</h3>
|
||||
|
||||
<a href="blog/2022-1-25.html">2021-1-25</a>
|
||||
<a href="blog/2022-1-31">2021-1-31</a>
|
||||
<a href="blog/forbidden">The forbidden blog post</a>
|
||||
|
||||
@@ -10,7 +10,6 @@ set host localhost:8000
|
||||
read / site/index.html
|
||||
read /hello site/hello.html
|
||||
throw /blog/forbidden 403
|
||||
exec /blog/2022-1-31 site/blog/blog/2022-1-31.sh
|
||||
read /blog/.* site/blog/
|
||||
#/blog/2021-1-25.html turns into site/blog//blog/2021-1-25.html
|
||||
linked /library
|
||||
|
||||
Reference in New Issue
Block a user