Created
June 11, 2014 17:47
-
-
Save ericfrederich/a004862e1da1fb6916ef to your computer and use it in GitHub Desktop.
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
#!/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