bashd
1.0.0

克隆项目
git clone https://github.com/AlexGustafsson/bashd
导航到文件夹
cd bashd
启动服务器
./bashd
Quickstart
特征
用法
贡献
常问问题
定义路线
route get / homePage
# Special 404 route - handles all 404s
route get 404 notFoundPage
# POST a message to the echo page to hear it back louder!
route post /echo echoPage处理页面
function homePage {
startResponse
cat << EOF
<html>
<head></head>
<body>
<h1>Hello, World!</h1>
</body>
</html>
EOF
}
function notFoundPage {
setResponseCode " 404 "
startResponse
cat << EOF
<html>
<head></head>
<body>
<h1>Cannot find $HTTP_METHOD $HTTP_PATH </h1>
</body>
</html>
EOF
}
function echoPage {
startResponse
cat << EOF
<html>
<head></head>
<body>
<h1> ${HTTP_BODY_MESSAGE^^} </h1>
</body>
</html>
EOF
}问:它有效吗?答:是的。
问:安全吗?答:不
问:这是个玩笑吗?答:主要是。
对该项目的任何帮助非常受欢迎。如有疑问,请发布问题。