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

    Function mapServiceDevPort

    • Creates a copy of a service definition (without mutating the original service definition) that maps the service's origin port to find the live port that's actually running.

      This is useful for situations in dev where backend automatically starts on a different port if the original port is already in use.

      Type Parameters

      Parameters

      Returns Promise<SpecificService>

      The service unchanged if it does not have a port number in its service origin.

      import {mapServiceDevPort} from '@rest-vir/define-service';

      const mappedService = await mapServiceDevPort(myServiceDefinition);

      Error if no valid starting port can be found or if the max scan distance has been reached without finding a valid port.