Last active
May 4, 2021 13:00
-
-
Save codemation/632c5d48ba61e775fd1b023af0562c4f to your computer and use it in GitHub Desktop.
fastapi_no_auth
This file contains hidden or 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, APIRouter | |
# import sub modules | |
from finance import finance | |
from hr import hr | |
from marketing import marketing | |
server = FastAPI() | |
@server.on_event('startup') | |
async def startup(): | |
finance_router = APIRouter(prefix='/finance', tags=['finance']) | |
hr_router = APIRouter(prefix='/hr', tags=['hr']) | |
marketing_router = APIRouter(prefix='/marketing', tags=['marketing']) | |
await finance.setup(finance_router) | |
await hr.setup(hr_router) | |
await marketing.setup(marketing_router) | |
server.include_router(finance_router) | |
server.include_router(hr_router) | |
server.include_router(marketing_router) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment