How to use the once function from http

Find comprehensive JavaScript http.once code examples handpicked from public code repositorys.

22
23
24
25
26
27
28
29
30
31
  res.end('worker: ' + cluster.worker.id);
});

if (!sticky.listen(server, 3000)) {
  // Master code
  server.once('listening', function() {
    console.log('server started on 3000 port');
  });
} else {
  // Worker code
fork icon0
star icon1
watch icon2