bashd
1.0.0

Cloner le projet
git clone https://github.com/AlexGustafsson/bashd
Accéder au dossier
cd bashd
Démarrer le serveur
./bashd
Start
Caractéristiques
Usage
Contributif
FAQ
Définir un itinéraire
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 echoPageManipulation des pages
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
}Q : Cela fonctionne-t-il? R : Oui.
Q : Est-ce sûr? R : Non.
Q : Est-ce une blague? R : Surtout.
Toute aide dans le projet est plus que bienvenue. En cas de doute, publiez un problème.