Skip to content

Instantly share code, notes, and snippets.

@ikennaokpala
Forked from stefansundin/heroku-replay.sh
Last active September 28, 2018 09:31
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save ikennaokpala/3e2f033ef7779b85a285a95db7055ab3 to your computer and use it in GitHub Desktop.
Save ikennaokpala/3e2f033ef7779b85a285a95db7055ab3 to your computer and use it in GitHub Desktop.
Replay production Heroku requests to your local dev environment.
#!/bin/bash -e
app=stylist
dev=http://stylist.mslabs.io
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
}
#!/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