Skip to content

Lack of use of State #174

Description

@Drvanon

Hi,
This is a super awesome project and it has been incredibly useful for me to structure the web API part of my project. Thank you so much.

I have a few comments in mind, but one of the first things that jumped out at me was your use of the Singleton pattern for settings and the database connection. I don't really like the singleton pattern (though I am sure you took care of the strongest arguments against it). So I was looking into what other options there are in the frameworks that you use, and once I learned more about tower, I expected it to be able to deliver the database/settings as a middleware quite nicely. I even found that a database connection is the example provided for state in the axum documentation.

I have a couple more thoughts that I can make issues for if you would like me to, but I thought I'd kick it off with this one.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions