import os
from flask import Flask, Response
import requests

app = Flask(__name__)

@app.route('/todo/api/v1/doc/<path:doc_link>',methods=['GET'])
def get_doc(doc_link):
    #the doc_link is the unique part of the pdf's url.
    #so for example, for the document at:
    #https://api.iga.in.gov/2015/bills/hb1001/versions
        #/hb1001.02.comh?format=pdf

    #the url here will be:
    #http://localhost:5000/todo/api/v1/doc/2015/bills
        #/hb1001/versions/hb1001.02.comh

    #also note that as of right now, their site fails http

    headers = {}
    headers['Authorization'] = os.environ['INDIANA_API_KEY']
    headers['Content-Type'] = "application/pdf"
    full_link = "https://api.iga.in.gov/" + doc_link + "?format=pdf"
    page = requests.get(full_link,headers=headers,verify=False)
    resp = Response(page.content)
    resp.headers["Content-Type"] = "application/pdf"

    return resp

if __name__ == "__main__":
    app.run(debug=True)
@@ -388,29 +388,9 @@
    #
-http://localhost:5000
+ 
 /tod
@@ -412,26 +412,16 @@
 15/bills
-%0A        #
 /hb1001/
@@ -503,16 +503,30 @@
 ils http
+s verification
 %0A%0A    he
@@ -883,16 +883,405 @@
 n resp%0A%0A
+@app.route(%22/%22)%0Adef index():%0A    description = %22%22%22Accessing Indiana's legislative documents %5C%0A                    without an API key is hard to do in a consistent %5C%0A                    way. This service requests the desired document %5C%0A                    using Open States' API key and make them searchable %5C%0A                    in the Open States interface.%22%22%22%0A%0A    return(description)%0A%0A%0A
 if __nam

index page with totally unstyled description