-
Notifications
You must be signed in to change notification settings - Fork 38
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
Redirect API decoupling #71
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Gonna take some time to review the PR, but i have a preliminary comment that you can address right away while i'm at it, and that's the weird code formatting that appears in various places throughout this branch's changelog
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Reading up on reflect metadata and inversify, will review the logic of it shortly, but there's some comments that we can begin discussing here
Pushed a new commit to address changes |
96c5cc7
to
d377c50
Compare
d377c50
to
cb8956a
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM 👍
Remember to use the squash and merge option |
Problem
The redirect API and model components are highly coupled. This makes it difficult to inject mocks for automated user testing. Prerequisite for solving #70
Solution
Decouple redirect API from Redis and Sequelize using InversifyJS. Split up code in the model component.
Improvements:
redirect.ts
has no knowledge of cache and database implementationindex.ts
inserver/model
has been split intouser.ts
andurl.ts
Deploy Notes
New dependencies:
inversify
: Dependency injection libraryreflect-metadata
: Allow the use of annotations in js/ts