MaCH repo
This commit is contained in:
21
02_hello_world_html/main.c
Normal file
21
02_hello_world_html/main.c
Normal file
@@ -0,0 +1,21 @@
|
||||
#include <mach.h>
|
||||
|
||||
config mach(){
|
||||
return (config) {
|
||||
.resources = {
|
||||
{"home", "/",
|
||||
.get = {
|
||||
input({"name", .matches = m_not_empty, .fallback = "world"}),
|
||||
render(.template =
|
||||
"<html>"
|
||||
"<head></head>"
|
||||
"<body>"
|
||||
"<p>Hello {{name}}</p>"
|
||||
"</body>"
|
||||
"</html>"
|
||||
)
|
||||
}
|
||||
}
|
||||
}
|
||||
};
|
||||
}
|
||||
Reference in New Issue
Block a user