From 2f12b256167582404222219a24e9728f77cde224 Mon Sep 17 00:00:00 2001 From: Alexandre Pretto Nunes Date: Tue, 5 Aug 2014 16:21:50 -0300 Subject: Make inboxapp-service serve the html, css and js files as well --- inboxapp-service/app/pixelated_service.py | 16 +++++----------- 1 file 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('/') -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') -- cgit v1.2.3