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
}問:它有效嗎?答:是的。
問:安全嗎?答:不
問:這是個玩笑嗎?答:主要是。
對該項目的任何幫助非常受歡迎。如有疑問,請發布問題。