yw5n.com/src/views.go
2024-12-10 18:30:56 +00:00

22 lines
497 B
Go

package main
import (
"net/http"
"path/filepath"
)
func Index(w http.ResponseWriter, r *http.Request) {
http.ServeFile(w, r, filepath.Join("html", "index.html"))
}
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) {
http.ServeFile(w, r, filepath.Join("html", r.URL.Path + ".html"))
}