Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

🔀 Add "Use a main router" advice #5

Open
wants to merge 2 commits into
base: main
Choose a base branch
from
Open

Conversation

p1-dta
Copy link

@p1-dta p1-dta commented Apr 29, 2024

I think this repository is a good idea!

Here is my first contribution, more oriented around code and file layout than technical stuff. However, this approach has been very helpful to me and teammates over the past few years.

What do you think?

@Kludex
Copy link
Owner

Kludex commented Apr 29, 2024

That's not exactly what I would recommend (naming wise).

I prefer to call the directory api/, and have a directory structure where the __init__.py contains the APIRouter, with the prefix based on the directory it is in.

@p1-dta
Copy link
Author

p1-dta commented Apr 29, 2024

@Kludex to clarify this point, the fastapi.FastAPI object ("app") is located in project/app.py, and the main router in project/api/__init__.py ? What name would you prefer ? TBH I never took the time to think of a better name. What do you suggest?

@p1-dta
Copy link
Author

p1-dta commented Jun 12, 2024

@Kludex bump?

Copy link
Owner

@Kludex Kludex left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm not sure I want to include this, because I think what's needed is a more structural advice than just the routing.

But here's my review... I'm nitpicking because I think this repository is supposed to be very opinionated.

@Kludex
Copy link
Owner

Kludex commented Nov 29, 2024

Sorry the delay. It's been hard.

Co-authored-by: Marcelo Trylesinski <[email protected]>
@p1-dta
Copy link
Author

p1-dta commented Dec 2, 2024

I really like your suggestions, I approved everything.

Sorry the delay. It's been hard.

No worries.

I'm not sure I want to include this, because I think what's needed is a more structural advice than just the routing.

A major issue in software is organization, structure of repository and projects. I consider this, if simple in essence, primordial in order to have a clean, well organized project.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants