Skip to content

Instantly share code, notes, and snippets.

@stefansundin
Last active August 30, 2018 17:39
Show Gist options
  • Star 2 You must be signed in to star a gist
  • Fork 1 You must be signed in to fork a gist
  • Save stefansundin/5a0b5832484c7dc1f08d481e314a0e52 to your computer and use it in GitHub Desktop.
Save stefansundin/5a0b5832484c7dc1f08d481e314a0e52 to your computer and use it in GitHub Desktop.
Replay production Heroku requests to your local dev environment.
#!/bin/bash -e
app=rssbox
dev=http://rssbox.dev
heroku logs -t -s heroku -d router -a $app | {
while IFS= read -r line
do
path=$(echo $line | grep -oE 'path="([^"]+)"' | cut -d'"' -f2)
code=$(curl -s -o /dev/null -w "%{http_code}" "$dev$path")
echo "$(date +%T) $code $dev$path"
done
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment