Spaces:
Running
Running
| from fastapi import FastAPI | |
| import threading | |
| import uvicorn | |
| from app.services.notification_service import notification_service | |
| from app.services.firebase import * # Ensure Firebase is initialized | |
| app = FastAPI() | |
| def read_root(): | |
| return {"message": "Notification Service is running"} | |
| def start_notification_service(): | |
| notification_service() | |
| notif_thread = threading.Thread(target=start_notification_service, daemon=True) | |
| notif_thread.start() | |
| if __name__ == "__main__": | |
| # Start notification service in a background thread | |
| # Run FastAPI server in the main thread | |
| uvicorn.run("app.main:app", host="0.0.0.0", port=8000, reload=False) | |