Created
October 29, 2020 14:51
-
-
Save MwinyiMoha/4d29dfa2b4e31c23b54a1e2b22875751 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from fastapi import FastAPI | |
from .database.utils import connect_mongo, disconnect_mongo | |
app = FastAPI() | |
app.add_event_handler('startup', connect_mongo) | |
app.add_event_handler('shutdown', disconnect_mongo) | |
@app.get('/') | |
def index(): | |
return {"Hola": "Mundo"} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment