baseddata.io/backend/main.py

16 lines
386 B
Python
Raw Normal View History

2024-09-20 17:49:31 +01:00
from fastapi import FastAPI
from pymongo.mongo_client import MongoClient
from routes.route import router
app = FastAPI()
client = MongoClient(
host=["10.0.10.35:27017"], username="admin", password="1234", authSource="admin"
)
try:
client.admin.command("ping")
print("Successfully pinged MongoDB deployment!")
except Exception as e:
print(e)
app.include_router(router)