Hi. Thanks for your explanation. It makes sense.

However, the "magic" I asked about was based on your first suggestion: 
simply use
http.Handle("/", http.FileServer(http.Dir("webpages")))

As I said, it works if the file to be shown is index.html. My question: how 
do I modify that in order to use main.html instead of index.html?

The whole program of my current unsuccessful attempt is in my post above. 
It works to show main.html but finds neither the css nor the js files.


Thanks!

On Monday, May 6, 2019 at 3:02:17 AM UTC-4, Miguel Angel Rivera Notararigo 
wrote:
>
> More than magic, it is a global convention. I guess it could be 
> interpreted as: when you access a directory, the web server will index its 
> content and will show you a list of links, if you want to override this 
> behavior, you could create your own index.
>
> See 
> https://github.com/golang/go/blob/b68624464dc41ffb09b9ee5314d3455904acd2a8/src/net/http/fs.go#L543
>

-- 
You received this message because you are subscribed to the Google Groups 
"golang-nuts" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to golang-nuts+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to