JAVASCRIPT 13
Finger.js Guest on 6th April 2021 03:06:44 AM
  1. /**************************************************
  2.  * ķ”„ė�œģ ¯ķŠø ėŖ… : FingerSnap
  3.  * ģ„¤     ėŖ… : ģ›¹ģ„œė¹„ģŠ¤ ģ‹¤ķ–‰ģ •ė³´
  4.  * ģ˛‘  ģ„±  ģ˛ : ķ—¬ė�œė¹„ģ¦ˆ
  5.  * ģ˛‘ ģ„± ģ¯¼ ģ˛ : 2021-02-17
  6.  * ------------------------------------------------
  7.  * 2021-02-17 : ģ´ˆģ•ˆ
  8.  **************************************************/--------------------
  9.  * 2021-02-17 : ģ´ˆģ•ˆ
  10.  **************************************************/
  11.  
  12. let ap/**
  13.  * Get port from environment and store in Express.
  14.  */rSnap:server');
  15. let http = require('http');
  16.  
  17. /**
  18.  * Get port from environment a/**
  19.  * Create HTTP server.
  20.  */ort = normalizePort(process.env.PORT ||/**
  21.  * Listen on provided port, on all network interfaces.
  22.  */*/
  23. let server = http.createServer(app);
  24.  
  25. /**
  26.  * Listen on provided port, on all network i/**
  27.  * Normalize a port into a number, string, or false.
  28.  */or);
  29. server.on('listening', onListening);
  30.  
  31. /**
  32.  * Normalize a port into a number, string,// named pipe
  33.  
  34. function normalizePort(val) {
  35.   let port = // port number
  36. 0);
  37.  
  38.   if (isNaN(port)) {
  39.     // named pi/**
  40.  * Event listener for HTTP server "error" event.
  41.  */umber
  42.     return port;
  43.   }
  44.  
  45.   return false;
  46. }
  47.  
  48. /**
  49.  * Event listener for HTTP server "error" event.
  50.  */
  51. function onError(error) {
  52.   if (error.syscall !== 'Port '') {
  53.     thr// handle specific listen errors with friendly messages
  54.    ? 'Pipe ' + port
  55.       : 'Port ' + port;
  56.  
  57.   // handle specific listen errors with friendly messages
  58.   switch (error.code) {
  59.     case 'EACCES':
  60.       console.error(bind + ' requires elevated privileges');
  61.       process.exit(1);
  62.       break;
  63.     case 'EADDRINUSE':
  64.       console.error(bi/**
  65.  * Event listener for HTTP server "listening" event.
  66.  */ak;
  67.     default:
  68.       throw error;
  69.   }
  70. }
  71.  
  72. /**
  73.  * Event listener for HTTP server "listening" event.
  74.  */
  75. function onListening() {
  76.   let addr = server.address();
  77.   let bind = typeof addr === 'string'
  78.       ? 'pipe ' + addr
  79.       : 'port ' + addr.port;
  80.   debug('Listening on ' + bi// http://programmingsummaries.tistory.com/375
  81. e.JS onListening ģ£¼ģ†Œ ė°¸ ķ¸¬ķŠø //ģ˜ˆģƒģ¹˜ ėŖ»ķ•œ ģ˜ˆģ™ø ģ²˜ė¦¬
  82. ogrammingsummaries.tistory.com/375
  83. process.on('uncaughtException', function (er//process.exit(1);
  84. 

Paste-bin is for source code and general debugging text.

Login or Register to edit, delete and keep track of your pastes and more.

Raw Paste

Login or Register to edit or fork this paste. It's free.