JackyChiu / realworld-starter-kit

Go examples API for a blog
https://realworld.io
21 stars 2 forks source link

[WIP] UserRefactor #21

Closed JackyChiu closed 6 years ago

guillaumemaka commented 7 years ago

Maybe we should move all the AddRoute declaration in main.go and pass the router to ListenAndServe ?

JackyChiu commented 7 years ago

Maybe we should move all the AddRoute declaration in main.go and pass the router to ListenAndServe ?

@guillaumemaka I like the idea of that since our "router builder" methods aren't really doing any specific logic. I'll do it in another PR

Another thing I'd like is to do is abstract the router to its own package (do you think middleware should go along with it?)

guillaumemaka commented 7 years ago

make sense to abstract the router and for middlewares we need a way to pass the DB and JWT interface that's currently available through the Handler struct, or maybe we could move DB, JWT and Logger to the router struct or make them available globally (not sure it's a good approach)

JackyChiu commented 7 years ago

@guillaumemaka this is still a "work in progress" btw

guillaumemaka commented 7 years ago

@JackyChiu I know. What's your current progress ? I'm currently working on the comments routes and the Gin implementation.

JackyChiu commented 7 years ago

I've been cleaning some stuff up, and will finish the users route sometime later this week or weekend