-
-
Notifications
You must be signed in to change notification settings - Fork 175
Cannot mount more than one subapp on the same path #159
Copy link
Copy link
Open
Description
Description
When trying to request a route from the second subapp mounted on the same path, it returns 404.
This happens because the first subapp responds with 404 (e.g. calls no match handler) and therefore doesn't switch to the next app, resulting in 404 even though the route is present in another app.
Code
import App from 'polka'
const router = App()
router.get('/upload', (req, res) => res.end('upload'))
const router2 = App()
router2.get('/product', (req, res) => res.end('product'))
const app = App()
app.use('/api/v1', router, router2)
app.listen(3000, () => console.log(`Started on :3000`))Expected result
$ curl localhost:3000/api/v1/product
productSame code but with Express v4 returns the expected result.
Actual result
$ curl localhost:3000/api/v1/product
Not FoundInfo
- polka:
1.0.0-next.11 - Node.js: 15.8
uname -r: 5.10.15-1-MANJARO
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels