27 lines
540 B
C
27 lines
540 B
C
#include <mach.h>
|
|
|
|
config mach(){
|
|
return (config) {
|
|
.resources = {{
|
|
{"home", "/",
|
|
.get = {{
|
|
validate((v){
|
|
.name = "name",
|
|
.validation = "^\\S{1,16}$",
|
|
.fallback = "world",
|
|
.message = "must be 1-16 characters, no spaces"
|
|
}),
|
|
render((r){
|
|
"<html>"
|
|
"<head></head>"
|
|
"<body>"
|
|
"<p>Hello {{name}}</p>"
|
|
"</body>"
|
|
"</html>"
|
|
})
|
|
}}
|
|
}
|
|
}}
|
|
};
|
|
}
|