﻿using System;
using System.ServiceModel;
using HelloIndigo;

namespace Host
{
    class Program
    {
        static void Main()
        {
            using (
                var host = new ServiceHost(typeof (HelloIndigoService),
                    new Uri("http://localhost:8000/HelloIndigo")))
            {
                host.AddServiceEndpoint(typeof (IHelloIndigoService),
                    new BasicHttpBinding(), "HelloIndigoService");
                host.Open();

                Console.WriteLine(
                    "Press <ENTER> to terminate the service host.");
                Console.ReadLine();
            }
        }
    }
}

﻿using System;
using System.ServiceModel;
using HelloIndigo;

namespace Host
{
    class Program
    {
        static void Main()
        {
            // A side effect (although perhaps documented)  of supplying 
            // a Uri to the ServiceHost contstructor is that this Uri
            // becomes the base address for the service. 
            using (
                var host = new ServiceHost(typeof (HelloIndigoService),
                    new Uri("http://localhost:8000/HelloIndigo")))
            {
                // By specifying the base address for the service when
                // constructing the ServiceHost, we can then specify 
                // endpoints using a relative address. That is, the 
                // complete address of the service is 
                // `http://localhost:8080/HelloIndigo/HelloIndigoService`.
                host.AddServiceEndpoint(typeof (HelloIndigoService),
                    new BasicHttpBinding(), "HelloIndigoService");
                host.Open();

                Console.WriteLine(
                    "Press <ENTER> to terminate the service host.");
                Console.ReadLine();
            }
        }
    }
}

Add comments about relative Service address.
Add comments about relative Service address.

Make no functional change; simply added comments to clarify that
solution uses a base address for the service, that the specific
service is specified using a relative address, and describing the
complete address of the service based on these two components.
