This commit is contained in:
Kenneth Reitz
2012-07-20 23:14:21 -04:00
parent edc3b795ad
commit 35af08b4a8
2 changed files with 19 additions and 0 deletions
+1
View File
@@ -5,4 +5,5 @@ distribute==0.6.27
gevent==0.13.7
greenlet==0.4.0
gunicorn==0.14.5
requests==0.13.3
wsgiref==0.1.2
+18
View File
@@ -1,14 +1,32 @@
#!/usr/bin/env python
import requests
from flask import Flask
from .versions import versions
DIST_BASE 'http://envy-versions.s3.amazonaws.com/'
app = Flask(__name__)
def fetch_dist(dist):
url = DIST_BASE + dist
r = requests.get(url)
r.raise_for_status()
return r.iter_content(1000)
@app.route("/")
def hello():
return "Hello World..."
@app.reoute('/dists/<dist>')
def get_dist(dist):
return fetch_dist(dist)
if __name__ == "__main__":
app.run()