18 lines
481 B
Python
18 lines
481 B
Python
from webapi.config.site_settings import site_settings
|
|
from beanie import init_beanie
|
|
from motor.motor_asyncio import AsyncIOMotorClient
|
|
from database.mongo.mongo_driver import MongoDriver
|
|
|
|
def register(app):
|
|
app.debug = site_settings.DEBUG
|
|
app.title = site_settings.NAME
|
|
|
|
@app.on_event("startup")
|
|
async def start_database():
|
|
await initiate_database()
|
|
|
|
|
|
async def initiate_database():
|
|
#init your database here
|
|
await MongoDriver().initiate_database()
|