Skip to content

Instantly share code, notes, and snippets.

@bcherny
Created December 14, 2013 22:17
Show Gist options
  • Save bcherny/7965665 to your computer and use it in GitHub Desktop.
Save bcherny/7965665 to your computer and use it in GitHub Desktop.
playing around with a flask server
# imports
from flask import Flask
import urllib
# instantiate server
app = Flask(__name__)
# vars
url ='http://snapguide.com/api/v1/guide/b995492d5e7943e3b2757a88fe3ef7c6'
# routes
@app.route('/')
def default():
return ''
@app.route('/data')
def data():
global url
return urllib.urlopen(url).read()
# start server
app.run()
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment