Function getOrigin

  • Return the origin for the specified resource.

    If the path is relative then an empty string is returned.

    Parameters

    • resource: string

      The resouce to get the host from.

    Returns string

    The host.