Skip to content

Instantly share code, notes, and snippets.

@codemation
Last active May 4, 2021 13:00
Show Gist options
  • Save codemation/632c5d48ba61e775fd1b023af0562c4f to your computer and use it in GitHub Desktop.
Save codemation/632c5d48ba61e775fd1b023af0562c4f to your computer and use it in GitHub Desktop.
fastapi_no_auth
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