16 lines
386 B
Python
16 lines
386 B
Python
|
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)
|