27 lines
498 B
Go
27 lines
498 B
Go
package main
|
|
|
|
import (
|
|
"net/http"
|
|
)
|
|
|
|
func index(w http.ResponseWriter, r *http.Request) {
|
|
r.URL.Path = "/contact"
|
|
html(w, r)
|
|
}
|
|
|
|
func style(w http.ResponseWriter, r *http.Request) {
|
|
http.ServeFile(w, r, "html/style.css")
|
|
}
|
|
|
|
func static(w http.ResponseWriter, r *http.Request) {
|
|
http.ServeFile(w, r, r.URL.Path)
|
|
}
|
|
|
|
func html(w http.ResponseWriter, r *http.Request) {
|
|
if t, found := TMPL[r.URL.Path]; found {
|
|
w.Write(t)
|
|
} else {
|
|
http.NotFound(w, r)
|
|
}
|
|
}
|