Skip to content

Instantly share code, notes, and snippets.

@Taormina
Last active August 29, 2015 14:05
Show Gist options
  • Save Taormina/063f8f76b09174eef88a to your computer and use it in GitHub Desktop.
Save Taormina/063f8f76b09174eef88a to your computer and use it in GitHub Desktop.
Placebo CLI
#!/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