rest-vir - v1.0.0
    Preparing search index...

    Function finalizeOptions

    • Combines user defined options with default options to create a full options type for startService.

      Parameters

      Returns {
          debug: boolean;
          host: string;
          lockPort: boolean;
          port: number;
          preventWorkerRespawn: boolean;
          workerCount: number;
      }

      • debug: boolean

        Set this to true to enable temporary extra logging. This should only be used in dev as it will fill up production log files if you have a decent amount of traffic.

        This works by overriding the given service's logger to ensure that it logs everything.

        false
        
      • host: string

        The host name that the server should listen to. In most cases this doesn't need to be set.

        'localhost'
        
      • lockPort: boolean

        Prevent automatically choosing an available port if the provided port is already in use. This will cause startService to simply crash if the given port is in use.

        false
        
      • port: number

        The port that the service should listen to requests on. Note that if lockPort is not set, startService will try to find the first available port starting with this given port property (so the actual server may be listening to a different port).

        If this property is set to false, no port will be listened to (so you can manually do that later if you wish).

        // the service definition's port or
        3000
      • preventWorkerRespawn: boolean

        If set to true, a multi-threaded service (workerCount > 1) will not automatically respawn its workers. This has no effect on single-threaded services (workerCount == 1).

        false
        
      • workerCount: number

        The number of workers to split the server into (for parallel request handling).

        cpus().length - 1
        

      startServiceOptionsShape for option explanations.