connect-history-api-fallback icon indicating copy to clipboard operation
connect-history-api-fallback copied to clipboard

Dealing with trailing slashes

Open meatnordrink opened this issue 4 years ago • 0 comments

Hi,

connect-history-api-fallback seems to disable Express's ability to handle trailing slashes, which normally just get removed.

For example:

  • https://my.app/signup - works.
  • https://my.app/signup/ - fails.

It seems like there must be some simple way around this, but I haven't been able to find one. Is there?

Thank you! A full snippet from my code is below, if that helps clarify things.

app.use(
  history({
    rewrites: [
      {from: /\/signup\//, to:'/signup'}
    ]
  }),
  express.static(path.join(dirname, 'some/directory'))
);

meatnordrink avatar Oct 15 '20 19:10 meatnordrink