22 lines
497 B
Go
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"))
|
|
}
|