hotspot / App /app.py
Mbonea's picture
testing deployment
9e798a1
raw
history blame
1.1 kB
from fastapi import FastAPI
from tortoise import Tortoise, run_async
from .Users.UserRoutes import user_router
from .Webhooks.webhookRoute import webhook_router
from .Subscriptions.SubscriptionRoutes import subscription_router
from .modelInit import TORTOISE_ORM
from .Payments.PaymentsRoutes import payment_router
from .Plans.PlanRoutes import plan_router
from .Portals.PortalRoutes import portal_router
app = FastAPI()
@app.on_event("startup")
async def startup_event():
await Tortoise.init(config=TORTOISE_ORM)
await Tortoise.generate_schemas()
@app.get("/")
async def landing_page():
return {"code": 200, "message": "still running"}
app.include_router(user_router)
app.include_router(webhook_router)
app.include_router(subscription_router)
app.include_router(payment_router)
app.include_router(plan_router)
app.include_router(portal_router)
if __name__ == "__main__":
import uvicorn
# Run the FastAPI app located at App.app:app
uvicorn.run(app, host="0.0.0.0", port=8000)
# if __name__ == "__main__":
# main()
# uvicorn.run(app, host="0.0.0.0", port=8000)