MaCH repo
This commit is contained in:
19
02_hello_world_html/main.c
Normal file
19
02_hello_world_html/main.c
Normal file
@@ -0,0 +1,19 @@
|
||||
#include <mach.h>
|
||||
|
||||
mach(main){
|
||||
context("greeting",
|
||||
"<html>"
|
||||
"<head></head>"
|
||||
"<body>"
|
||||
"<p>Hello {{name}}</p>"
|
||||
"</body>"
|
||||
"</html>"
|
||||
);
|
||||
resource("home", "/",
|
||||
.get = {
|
||||
input({"name", .fallback = "world"}),
|
||||
mustache("greeting", "hello"),
|
||||
respond("hello")
|
||||
}
|
||||
);
|
||||
}
|
||||
Reference in New Issue
Block a user