Skip to content

Conversation

@pixcai
Copy link

@pixcai pixcai commented Jun 15, 2018

const http = require('http')
const connect = require('connect')

const app = connect()
const server = http.createServer()

server.addListener('request', (req, res) => console.log('hello'))
server.addListener('request', (req, res) => console.log('world'))

app.use('/hello', server)
app.use('/hello', (req, res) => res.end('nodejs'))

app.listen(3000)

If only use the first handler, "hello" can be output to the console, however "world" and res.end('nodejs') will not be invoked, while emit('request') can. Maybe we should do this?

@dougwilson
Copy link
Contributor

It's certainly possible to add. Can you add tests to our test suite for this, please?

@pixcai
Copy link
Author

pixcai commented Jun 15, 2018

Update and add test

Copy link

@WestPop1 WestPop1 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Gracias

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants