Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
talentlessguy opened this issue Jun 24, 2021 · 0 comments

Comments

@talentlessguy
Copy link
Collaborator

@talentlessguy talentlessguy commented Jun 24, 2021

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.

Versions

  • node: 16.3
  • @tinyhttp/app: 1.3.11

Additional context

#276

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Linked pull requests

Successfully merging a pull request may close this issue.

None yet
1 participant