Assuming you have a folder beside your main.py called ./routes, in which you have your router files (must include a router variable, which is likely your fastapi.APIRouter instance.)
This main.py script loads in all your routes.
Throwing it on here so I can find it later, might be helpful to you guys as well.
Files prefixed with nr_, for example, nr_database.py, are ignored by the script. nr standing for not router.
TheOnlyWayUp © 2023