On 01/13/2018 11:26 PM, Constantine Vassilev wrote:
> Here is how I implemented it:
>
Well -- just to be clear: I think my solution is wrong. I didn't
understand how http.ServeMux worked:
https://golang.org/pkg/net/http/#ServeMux
Andy Balholm pointed out that http.Handle() can accept a
Here is how I implemented it:
func wwwAssetsHandler(w http.ResponseWriter, r *http.Request) {
if r.Host == "domain.net" || r.Host == "www.domain.net" || r.Host ==
"domain.com" || r.Host == "www.domain.com" {
var webrootStr = homePath + "/Desktop/" + "www.domain.com"
fs :=
On 01/09/2018 02:34 PM, Andy Balholm wrote:
> Try:
>
> http.Handle(“domain1.com/assets/", http.StripPrefix("/",
> http.FileServer(http.Dir(*webrootdomain1
> http.Handle(“domain2.com/assets/", http.StripPrefix("/",
> http.FileServer(http.Dir(*webrootdomain2
>
Wow! Reading is
Try:
http.Handle(“domain1.com/assets/", http.StripPrefix("/",
http.FileServer(http.Dir(*webrootdomain1
http.Handle(“domain2.com/assets/", http.StripPrefix("/",
http.FileServer(http.Dir(*webrootdomain2
--
You received this message because you are subscribed to the Google Groups
Constantine Vassilev wrote:
>
> I have web server serving requests from two domains: domain1.com and
> domain2.com
> The assets directories are different for the two domains.
>
> webrootdomain1/assets
> and
> webrootdomain2/assets
>
> How to make the handler for assets to
I have web server serving requests from two domains: domain1.com and
domain2.com
The assets directories are different for the two domains.
webrootdomain1/assets
and
webrootdomain2/assets
How to make the handler for assets to serve different directory depending
from
the requests from