text: const { httpServer, settings } = require("./server");
  var debug = require("debug")("obs-elements:server");
  require("./socket-io");
  
  httpServer.listen(settings.port);
  httpServer.on("error", onError);
  httpServer.on("listening", onListening);
  
  /**
   * Event listener for HTTP server "error" event.
   */
  
  function onError(error) {
    if (error.syscall !== "listen") {
      throw error;
    }
  
    var bind =
      typeof settings.port === "string"
        ? "Pipe " + settings.port
        : "Port " + settings.port;
  
    // handle specific listen errors with friendly messages
    switch (error.code) {
      case "EACCES":
        console.error(bind + " requires elevated privileges");
        process.exit(1);
        break;
      case "EADDRINUSE":
        console.error(bind + " is already in use");
        process.exit(1);
        break;
      default:
        throw error;
    }
  }
  
  /**
   * Event listener for HTTP server "listening" event.
   */
  
  function onListening() {
    var addr = httpServer.address();
    var bind = typeof addr === "string" ? "pipe " + addr : "port " + addr.port;
    debug("Listening on " + bind);
  }
  