chainetv_web/backend/app.py

20 lines
648 B
Python
Raw Normal View History

2019-04-29 14:23:24 +00:00
from flask import Flask,render_template
from flask_cors import CORS
from api import api
#from ReverseProxied import ReverseProxied
def create_app(app_name=__name__):
app=Flask(__name__, static_folder= "./dist/static",template_folder="./dist")
app.config.from_object('config.BaseConfig')
#app.wsgi_app = ReverseProxied(app.wsgi_app)
CORS(app)
app.register_blueprint(api, url_prefix="/api/v1")
@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)