Skip to content

Multiple sub-apps mounted on the same route result in Not Found for further subapps #279

@v1rtl

Description

@v1rtl

Describe the bug

When you mount two apps on the same route only the first one works and the other doesn't get reached.

To Reproduce

import { App } from '@tinyhttp/app'

const app = new App(), app1 = new App(), app2 = new App()

app2.use((req, res, next) => {
	console.log('ping')
	res.send('hi from app 2')
})

app1.use((req, res, next) => {
	console.log('pong')
	next()
})

app.use('/test', app1)
app.use('/test', app2)


app.listen(3000)
$ curl localhost:3000/test
Not Found

Expected behavior

if not found it should go to the next app and send "hi from app 2"

Versions

  • node: 16.3
  • @tinyhttp/app: 1.3.11

Additional context

#276

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't workingcoreAffects `@tinyhttp/app` - the tinyhttp coregood first issueGood for newcomershelp wantedExtra attention is needed

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions