MaCH repo
This commit is contained in:
18
01_hello_world_text/main.c
Normal file
18
01_hello_world_text/main.c
Normal file
@@ -0,0 +1,18 @@
|
||||
#include <mach.h>
|
||||
|
||||
config mach(){
|
||||
return (config) {
|
||||
.resources = {
|
||||
{"home", "/", .mime = mime_txt,
|
||||
.get = {
|
||||
validate({"name",
|
||||
.validation = "^\\S{1,16}$",
|
||||
.fallback = "world",
|
||||
.message = "must be 1-16 characters, no spaces"
|
||||
}),
|
||||
render(.template = "Hello {{name}}")
|
||||
}
|
||||
}
|
||||
}
|
||||
};
|
||||
}
|
||||
Reference in New Issue
Block a user