zele-backend/main.py

22 lines
471 B
Python
Raw Normal View History

2024-08-08 10:53:32 -04:00
import os
from dotenv import load_dotenv
from flask import Flask
2024-10-23 09:21:48 -04:00
from flask_cors import CORS
2024-08-08 10:53:32 -04:00
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)
2024-10-23 09:21:48 -04:00
CORS(app, resources={r"/find_agents": {"origins": os.getenv("ORIGINS")}})
2024-08-08 10:53:32 -04:00
if __name__ == '__main__':
app.run(debug=True)