Last active
October 30, 2020 09:32
-
-
Save MwinyiMoha/7ebdf571e1569186a04bef78f20c7e6c 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 .api.endpoints import router as todo_router | |
from .database.utils import connect_mongo, disconnect_mongo | |
app = FastAPI(title='Todos API') | |
app.add_event_handler('startup', connect_mongo) | |
app.add_event_handler('shutdown', disconnect_mongo) | |
app.include_router(todo_router, prefix='/todos') | |
@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