scottcorgan / pushstate-server

Static file server that works with HTML5 Pushstate.
421 stars 35 forks source link

Option to add custom middleware #48

Open timswalling opened 7 years ago

timswalling commented 7 years ago

First, let me just say thanks for all your hard work on this!

I've come across a couple of instances where it I've needed to install some basic middleware - eg logging or authentication. While these can be handled on a case-by-case basis (eg #46), I think including a generic way of adding middleware would be both safe and useful.

Please note that I've modified the tests so that a new connect app is created for each test, otherwise the middleware persists between tests.