diff --git a/ITPlanning/app.py b/ITPlanning/app.py index f73b59f..a3fd583 100644 --- a/ITPlanning/app.py +++ b/ITPlanning/app.py @@ -4,9 +4,10 @@ from logging.handlers import TimedRotatingFileHandler from flask import Flask from pony.flask import Pony from ITPlanning.api import api -#from ITPlanning.frontend import frontend from ITPlanning.db import init_database from ITPlanning.config import IniConfig +from ITPlanning.frontend import frontend + logger = logging.getLogger("ITPlanning") @@ -29,7 +30,11 @@ def create_app(): logger.setLevel(getattr(logging, loglevel.upper(), logging.NOTSET)) # Initialize database - logger.warning(app.config["BASE"]["database_uri"]) init_database(app.config["BASE"]["database_uri"]) Pony(app) + + # create flask blueprint + app.register_blueprint(api, url_prefix="/api/v1") + app.register_blueprint(frontend) + return app diff --git a/ITPlanning/frontend/__init__.py b/ITPlanning/frontend/__init__.py index e69de29..51d4b8a 100644 --- a/ITPlanning/frontend/__init__.py +++ b/ITPlanning/frontend/__init__.py @@ -0,0 +1,8 @@ +from flask import Blueprint, render_template + +frontend = Blueprint("frontend", __name__) + + +@frontend.route("/") +def index(): + return render_template("index.html") diff --git a/ITPlanning/view/index.html b/ITPlanning/view/index.html new file mode 100644 index 0000000..fd64ba1 --- /dev/null +++ b/ITPlanning/view/index.html @@ -0,0 +1,7 @@ + + + +ITPLANNING! + + +