Answer the question
In order to leave comments, you need to log in
How to specify a shared directory on the server plus a personal one?
There is a regular routing on the Go server:
http.Handle("/", http.FileServer(http.Dir("c:/serverGo/www/site.com/")))
http.HandleFunc("/about", func(w http.ResponseWriter, r *http.Request) {
http.ServeFile(w, r, "c:/serverGo/www/site.com/about.html")
})
http.HandleFunc("/blog/", func(w http.ResponseWriter, r *http.Request) {
// Тут контроль последнего элемента в Пути_URL'а; и если это "345", то:
http.ServeFile(w, r, "c:/serverGo/www/site.com/345.html")
})
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question