13 lines
471 B
Python
13 lines
471 B
Python
from flask import Flask
|
|
from app.routes import main
|
|
from flask_cors import CORS
|
|
import os
|
|
|
|
def create_app():
|
|
base_dir = os.path.abspath(os.path.dirname(__file__))
|
|
template_path = os.path.join(base_dir, '..', 'templates')
|
|
static_path = os.path.join(base_dir, '..','static')
|
|
app = Flask(__name__, template_folder=template_path, static_folder=static_path)
|
|
CORS(app, resources={r"/api/*": {"origins": "*"}})
|
|
app.register_blueprint(main)
|
|
return app |