Closed geelen closed 8 years ago
That's a great package and a change I want to see made. This package started as just an experiment to get something working years ago and I guess people started using it.
With that said, I'd love to make this change with tests (which are there are none of at the moment). Any way I could get you to add some tests for this kind of change?
Thanks!
@geelen I've added the initial tests in master. They're not all there, but there's enough I think to prove that this PR passes. Go ahead and rebase and let me know.
@scottcorgan done.
Published as 2.0.0
, among other upgrades. Thanks again!
This simplifies the implementation, since you no longer need to maintain a list of file type extensions. Now, if a file is found by
serveStatic
, it'll be served. If not, fall back toindex.html
(or whateverfile
you set).The advantage here is that if you do have static
html
files in the directory, they'll be served straight up. Which is super handy if you're mixing-and-matching pushstate and static pages, or if you're doing some React prerendering.I think this is a more expected behaviour, and should make things easier to maintain in the long run (since you don't have to keep adding file extensions to the
connect-modrewrite
list)