make discovery base URL configurable

According to #3

Add three env for init leader detection and server peer communication etc.

1. DISCOVERY_ROOT_URL : default https://discovery.etcd.io
2. DISCOVERY_ORIGIN_ADDR : default http://127.0.0.1:4001
3. DISCOVERY_INIT_LEADER : default 127.0.0.1:4001
Yup. I have a branch that fixes this and more up and gets it all working
based on this original PR.

On Wednesday, October 15, 2014, Skylar Saveland <notifications@github.com>
wrote:

> In handlers/new.go:
>
> > @@ -61,5 +70,10 @@ func NewTokenHandler(w http.ResponseWriter, r *http.Request) {
> >
> >  	log.Println("New cluster created", token)
> >
> > -	fmt.Fprintf(w, "https://discovery.etcd.io/"+token)
> > +	var domain = os.Getenv("DISCOVERY_ROOT_URL")
> > +	if domain == "" {
> > +		domain = "https://discovery.etcd.io"
> > +	}
> > +
> > +	fmt.Fprintf(w, path.Join(domain, token))
>
> One would think this would work; but, I think that path.Join will remove
> a crucial slash here.
>
> `path.Join("http://foo", "bar") == "http:/foo/bar"
>
> —
> Reply to this email directly or view it on GitHub
> <https://github.com/coreos/discovery.etcd.io/pull/5/files#r18924604>.
>


-- 
Raymond "VisualPhoenix" Barbiero