The auth/ route was growing tremendously, which necessitated splitting it up into separate files for easier management.
I created a controllers folder, and extracted out each associated auth controller. Types were reincorporated with each, and a universal Controller type was extracted to manage each controller’s function signature.
Additionally, the addCardToInventory controller’s validation middleware was combined with the actual controller to streamline it.
Summary
The
auth/
route was growing tremendously, which necessitated splitting it up into separate files for easier management.I created a
controllers
folder, and extracted out each associated auth controller. Types were reincorporated with each, and a universal Controller type was extracted to manage each controller’s function signature.Additionally, the
addCardToInventory
controller’s validation middleware was combined with the actual controller to streamline it.