parent
abd9218561
commit
9420df0a4c
11 changed files with 29 additions and 28 deletions
|
@ -16,8 +16,9 @@ var routes = []struct {
|
|||
handler http.HandlerFunc
|
||||
}{
|
||||
{[]string{"GET"}, url(""), index},
|
||||
{[]string{"GET"}, url("/(pgp.asc|ssh)"), static},
|
||||
{[]string{"GET"}, url("/static/.+"), static},
|
||||
{[]string{"GET"}, url("/(.+\\.(css|js))"), file},
|
||||
{[]string{"GET"}, url("/(.+\\.css)"), css},
|
||||
{[]string{"GET"}, url("/([^/]+)"), html},
|
||||
}
|
||||
|
||||
|
|
|
@ -13,8 +13,8 @@ func static(w http.ResponseWriter, r *http.Request) {
|
|||
http.ServeFile(w, r, r.URL.Path)
|
||||
}
|
||||
|
||||
func file(w http.ResponseWriter, r *http.Request) {
|
||||
http.ServeFile(w, r, filepath.Join(getParam(r, 1), getParam(r, 0)))
|
||||
func css(w http.ResponseWriter, r *http.Request) {
|
||||
http.ServeFile(w, r, filepath.Join("css", getParam(r, 0)))
|
||||
}
|
||||
|
||||
func html(w http.ResponseWriter, r *http.Request) {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue