CShore/demo/demo.c

17 lines
281 B
C
Raw Normal View History

2021-04-29 16:40:41 +00:00
#include <stdlib.h>
#include <stdio.h>
2021-04-30 11:36:06 +00:00
#include <controller.h>
2021-04-29 16:40:41 +00:00
GET("/", hello);
GET("/index.*", hello);
response_t hello(ctx_t ctx) {
return rawResponse(200, "Hello World\n");
}
GET("/foobar", foobar);
response_t foobar(ctx_t ctx) {
2021-04-30 11:36:06 +00:00
return fileResponse("demo/foobar.txt");
2021-04-29 16:40:41 +00:00
}