Modularize api#100
Conversation
This commit is just modularization, refactoring will come later
marcosfrenkel
left a comment
There was a problem hiding this comment.
The settings import is still the old settings file. Other than that it looks good.
Do we need to have 2 main files? specially since the only thing both of them do is add the other routes.
|
This PR just modularizes what was already there from #96, without any further additions or refactoring. The reason for multiple main files is to enforce separation of concerns. As more api routes are added, there is no need to modify the top level file. When we add web views, we can consolidate them into a single router and have a minimal change in the top level file to include that router. |
|
The imports are making the program crash, the old settings.py file doesn't exist anymore |
|
This structure also follows what I've already set up in the webapp branch according to the full stack FastAPI template. |
| from pqnstack.app.settings import settings | ||
| from pqnstack.app.settings import state |
There was a problem hiding this comment.
This should be from pqnstack.app.core.config import settings and from pqnstack.app.core.config import state
| from pqnstack.app.settings import settings | ||
| from pqnstack.app.settings import state |
| from fastapi import HTTPException | ||
| from fastapi import status | ||
|
|
||
| from pqnstack.app.settings import settings |
|
Should be fixed now |
This commit is just modularization, refactoring will come later