zele-backend/main.py
2024-10-23 09:21:48 -04:00

22 lines
471 B
Python

import os
from dotenv import load_dotenv
from flask import Flask
from flask_cors import CORS
from flask_sqlalchemy import SQLAlchemy
from routes import register_route
load_dotenv()
db = SQLAlchemy()
app = Flask(__name__)
app.config['SQLALCHEMY_DATABASE_URI'] = os.getenv("SQLALCHEMY_DATABASE_URI")
db.init_app(app)
register_route(app, db)
CORS(app, resources={r"/find_agents": {"origins": os.getenv("ORIGINS")}})
if __name__ == '__main__':
app.run(debug=True)