Last active
August 29, 2015 14:05
-
-
Save Taormina/063f8f76b09174eef88a to your computer and use it in GitHub Desktop.
Placebo CLI
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
FLASK='http://127.0.0.1:5000' | |
if [ "$1" = "add" ] | |
# Update or add a new dummy endpoint at path $2 that returns $3 | |
then | |
curl -H "Content-Type: application/json" -d $3 $FLASK/reserved/$2 | |
elif [ "$1" = "del" ] | |
# Delete the endpoint at path $2 | |
then | |
curl -X DELETE $FLASK/reserved/$2 | |
elif [ "$1" = "get" ] | |
# Get the information at path $2 | |
then | |
curl $FLASK/dummy/$2 | |
else | |
# Help | |
echo "Usage: ./placebo.sh <add|del|get> [path] [data]" | |
fi |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment