gorilla / mux

Package gorilla/mux is a powerful HTTP router and URL matcher for building Go web servers with 🦍
https://gorilla.github.io
BSD 3-Clause "New" or "Revised" License
20.92k stars 1.85k forks source link

fix SPA handler in README.md #733

Closed sy9 closed 1 year ago

sy9 commented 1 year ago

What type of PR is this? (check all applicable)

Description

Changed the SPA handler example in README.md in two areas. First, made sure to actually include the requested path in the call to filepath.Join. Secondly, if the requested path hits a directory, I think it would be beneficial to also serve the indexPath file, and not list the directory contents. I also edited the comments in the README.md file accordingly.

Related Tickets & Documents

Added/updated tests?

Run verifications and test

codecov[bot] commented 1 year ago

Codecov Report

Merging #733 (f7e3116) into main (4a671cb) will not change coverage. The diff coverage is n/a.

@@           Coverage Diff           @@
##             main     #733   +/-   ##
=======================================
  Coverage   78.04%   78.04%           
=======================================
  Files           5        5           
  Lines         902      902           
=======================================
  Hits          704      704           
  Misses        142      142           
  Partials       56       56           
AlexVulaj commented 1 year ago

Thanks for the contribution @sy9 ! Looks good to me.