chainetv_web/backend/chainetv/app.py
2019-05-08 14:14:55 +02:00

22 lines
689 B
Python

from flask import Flask,render_template
from flask_cors import CORS
#from ReverseProxied import ReverseProxied
def create_app(app_name=__name__):
app=Flask(__name__, static_folder= "../dist/static",template_folder="../dist")
app.config.from_object('chainetv.config.BaseConfig')
#app.wsgi_app = ReverseProxied(app.wsgi_app)
CORS(app)
from .api import api
app.register_blueprint(api, url_prefix="/api/v1")
@app.route('/')
@app.route('/<path:path>')
def index(path="/"):
return render_template('index.html')
return app
##@app.errorhandler(404)
##def ma_page_404(error):
## return redirect("https://www.ducamps.win/404/404.html", 307)