Skip to content

Instantly share code, notes, and snippets.

@ericfrederich
Created June 11, 2014 17:47
Show Gist options
  • Save ericfrederich/a004862e1da1fb6916ef to your computer and use it in GitHub Desktop.
Save ericfrederich/a004862e1da1fb6916ef to your computer and use it in GitHub Desktop.
#!/usr/bin/env python
import sys
from bottle import get, run, response
PORT = int(sys.argv[1])
STATUS = int(sys.argv[2])
@get('/old')
def index():
response.status = STATUS
response.set_header('Location', '/new')
return "UH OH1"
@get('/new')
def index():
response.status = STATUS
response.set_header('Location', '/newer')
return "UH OH2"
@get('/newer')
def index():
response.status = STATUS
response.set_header('Location', '/newest')
return "UH OH3"
@get('/newest')
def index():
return "HOORAY"
run(host='localhost', port=PORT)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment