Best way to create handler for router with testability in mind

Written by
Link to Post by 

I am using a chi to do my routing for me, and i have very basic handler that would GET a value from the db. My db statements occur in my handler. I am wondering if this is too tightly coupled and testing it would be a problem. If so what is the best way to 1. test a handler 2. stub out the sql portion of the handler

Any help would be greatly appreciated thanks.

submitted by /u/Gbyrd99
[link] [comments]

Article Tags:
· ·
Article Categories:

Leave a Reply