-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathrun.py
More file actions
27 lines (19 loc) · 651 Bytes
/
run.py
File metadata and controls
27 lines (19 loc) · 651 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
"""app initializer """
from api import create_app
import os
from flask import redirect, make_response, jsonify
# Create app instance with env
def app_context():
if os.getenv("FLASK_ENV") is None:
application = create_app('testing')
return application
application = create_app(os.getenv("FLASK_ENV"))
return application
app = app_context()
# Create a URL route in our application for "/"
@app.route('/docs')
def home():
return redirect('https://politicoapi2.docs.apiary.io/#', 302,
make_response(jsonify({"message": "redirecting to documentation"})))
if __name__ == '__main__':
app.run()