Home »
MCQs »
Express.js MCQs
What does the following do, app.listen(port, [host], [backlog], [callback]])?
6. What does the following do, app.listen(port, [host], [backlog], [callback]])?
- This method specifies what to execute when a get request at the specified route is made
- This function binds and waits for connections on the provided host and port
- This method accepts an object as input and returns it to the requesting client
Answer: B) This function binds and waits for connections on the provided host and port.
Explanation:
app.listen(port, [host], [backlog], [callback]]), this function binds and waits for connections on the provided host and port.