vercel/serve-handler

pass all static requests, but rewrite the api/html requests

ImHype opened this issue · 2 comments

I have some requests, just like:

/page-a
/page-b
/static/xxx/a.aaa.js
/static/xxx/b.bbb.js
  • page-a and page-b response public/index.html.
  • /static/xxx/a.aaa.js response public/static/xxx/a.aaa.js
  • /static/xxx/b.bbb.js response public/static/xxx/b.bbb.js

Negative lookahead is your friend

rewrites": [{
    "source": "/((?!api\/.*).*)",
    "destination": "/index.html"
  }]

ok. i see