diff options
author | Alexandre Pretto Nunes <anunes@thoughtworks.com> | 2014-08-05 16:21:50 -0300 |
---|---|---|
committer | Alexandre Pretto Nunes <anunes@thoughtworks.com> | 2014-08-05 16:34:44 -0300 |
commit | 2f12b256167582404222219a24e9728f77cde224 (patch) | |
tree | 5df940b0e3d969f40a52eaf77dc1f1851a10290a | |
parent | f0108c072f5f27382d335331b1fba44c972a6fa8 (diff) |
Make inboxapp-service serve the html, css and js files as well
-rw-r--r-- | inboxapp-service/app/pixelated_service.py | 16 |
1 files changed, 5 insertions, 11 deletions
diff --git a/inboxapp-service/app/pixelated_service.py b/inboxapp-service/app/pixelated_service.py index f3eb52d7..7c60b513 100644 --- a/inboxapp-service/app/pixelated_service.py +++ b/inboxapp-service/app/pixelated_service.py @@ -1,4 +1,4 @@ -from flask import Flask, request, Response +from flask import Flask, request, Response, redirect from factory import MailConverterFactory, ClientFactory from search import SearchQuery @@ -6,7 +6,7 @@ import json import datetime import requests -app = Flask(__name__) +app = Flask(__name__, static_url_path='', static_folder='../../web-ui/app') client = None converter = None account = None @@ -107,15 +107,9 @@ def draft_reply_for(mail_id): return respond_json(None) -@app.route('/', defaults={'path': ''}) -@app.route('/<path:path>') -def redirect_to_front(path): - response = requests.get("http://localhost:9000/%s" % path) - return Response( - response=response, - status=response.status_code, - content_type=response.headers['content-type'] - ) +@app.route('/') +def index(): + return app.send_static_file('index.html') if __name__ == '__main__': app.config.from_envvar('PIXELATED_SERVICE_CFG') |