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

Error in Usage example #120

Closed
HeyJ0e opened this issue Dec 3, 2019 · 0 comments
Closed

Error in Usage example #120

HeyJ0e opened this issue Dec 3, 2019 · 0 comments

Comments

@HeyJ0e
Copy link

HeyJ0e commented Dec 3, 2019

The Usage section tells:

polka()
  .use(one, two)
  .get('/users/:id', (req, res) => {
    console.log(`~> Hello, ${req.hello}`);
    res.end(`User: ${req.params.id}`);
  })
  .listen(3000, err => {
    if (err) throw err;
    console.log(`> Running on localhost:3000`);
  });

Where the listen provides a handler which expects err.

.listen(3000, err => {

The thing is, err will be always undefined as listening event provides nothing.
listening event documentation: https://nodejs.org/api/net.html#net_event_listening

lukeed added a commit that referenced this issue May 22, 2021
@lukeed lukeed closed this as completed in 2ce10df May 22, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant