diff --git a/backend/app.py b/backend/app.py index 6f8e7cc..ef6d543 100644 --- a/backend/app.py +++ b/backend/app.py @@ -1,13 +1,18 @@ +from sys import prefix from flask import Flask from db.model import db from config import * +from blueprints.profile import profile as profileBlueprint app = Flask(__name__) app.config["SQLALCHEMY_DATABASE_URI"] = DB_URI db.init_app(app) +app.register_blueprint(profileBlueprint,url_prefix='/api') + + @app.route('/', methods=['GET', 'POST']) def homepage(): - return {'message': 'Cocks were sucked !'}, 200 + return {'message': 'Welcome back !'}, 200 if __name__ == '__main__': with app.app_context(): diff --git a/backend/blueprints/profile/__init__.py b/backend/blueprints/profile/__init__.py new file mode 100644 index 0000000..83b5beb --- /dev/null +++ b/backend/blueprints/profile/__init__.py @@ -0,0 +1,7 @@ +from flask import Blueprint + +profile = Blueprint('profile', __name__) + +@profile.route('/profile') +def get_profile(): + return "Profile Page" \ No newline at end of file diff --git a/backend/config.py b/backend/config.py index 8aba1ae..50abd11 100644 --- a/backend/config.py +++ b/backend/config.py @@ -1,9 +1,13 @@ +from json import load import os +from dotenv import load_dotenv + +load_dotenv() DB_ENGINE: str = "postgresql" DB_USER: str = "postgres" -DB_PASSWORD: str = "1234" -DB_HOST: str = "localhost" +DB_PASSWORD: str = os.getenv('DB_PASSWORD','12345') +DB_HOST: str = "127.0.0.1" DB_PORT: int = 5432 DB_NAME: str = "educonnect" diff --git a/backend/requirements.txt b/backend/requirements.txt new file mode 100644 index 0000000..f94a1e5 Binary files /dev/null and b/backend/requirements.txt differ