yusukebe / revealgo

Markdown driven presentation tool written in Go!
MIT License
237 stars 22 forks source link

Define http handlers as functions #6

Closed jossemarGT closed 3 years ago

jossemarGT commented 3 years ago

Background

Hi, is me again :octocat:. I just finished with the revealgo + multiplex integration, and you can see how it looks on this branch. Unfortunately, when I was cleaning up what I did on said branch I found myself doing a mild refactor in the process, so instead of disturbing you with a big change I would rather split it in two separated pull requests (so expect another one coming from my side).

What changed?

I did a mild refactor with the sole goal of reutilizing the exisiting handlers alongside others and the stdlib ones. In this way the upcoming changes can be designed as small "middlewares" insted of complex types with some business logic on them.

By the way, I think this might solve #4 since now revealgo uses the http.Dir stdlib function to serve the content. Either way, I am not 100% since I am not a Windows user :man_shrugging:.

yusukebe commented 3 years ago

Great pull request! Your refactoring makes our code simple and short. Thank you.