静态响应
静态响应
语法
respond [<matcher>] <status>|<body> [<status>] {
body <text>
close
}
示例
example.com {
# /health-check 路径返回 200 状态码
respond /health-check 200
# 全部路径返回 "Hello, world!", 默认返回 200 状态码
respond "Hello, world!"
# 全部路径返回 404 状态码
respond 404
# 返回多行内容, 状态码 200
respond <<HTML
<html>
<head><title>Foo</title></head>
<body>Foo</body>
</html>
HTML 200
}