#!/usr/bin/env python # -*- coding: utf-8 -*- import os from flask import render_template, send_from_directory, Blueprint fe_path = os.path.join(os.getcwd(), "frontend", "dist") fe_bp = Blueprint('frontend', __name__, url_prefix='/', template_folder=os.path.join(fe_path, "")) @fe_bp.route('/js/') def send_js(path): return send_from_directory(os.path.join(fe_path, "js"), path) @fe_bp.route('/css/') def send_css(path): return send_from_directory(os.path.join(fe_path, "css"), path) @fe_bp.route('/img/') def send_img(path): return send_from_directory(os.path.join(fe_path, "img"), path) @fe_bp.route('/', defaults={'path': ''}) @fe_bp.route('/') def catch_all(path): return render_template("index.html")