30 lines
1019 B
Go
30 lines
1019 B
Go
|
package main
|
||
|
|
||
|
import (
|
||
|
"net/http"
|
||
|
"path"
|
||
|
|
||
|
"github.com/julienschmidt/httprouter"
|
||
|
)
|
||
|
|
||
|
func init() {
|
||
|
router.GET("/", func(w http.ResponseWriter, r *http.Request, ps httprouter.Params) {
|
||
|
http.ServeFile(w, r, path.Join(StaticDir, "index.html"))
|
||
|
})
|
||
|
router.GET("/css/*_", func(w http.ResponseWriter, r *http.Request, ps httprouter.Params) {
|
||
|
http.ServeFile(w, r, path.Join(StaticDir, r.URL.Path))
|
||
|
})
|
||
|
router.GET("/fonts/*_", func(w http.ResponseWriter, r *http.Request, ps httprouter.Params) {
|
||
|
http.ServeFile(w, r, path.Join(StaticDir, r.URL.Path))
|
||
|
})
|
||
|
router.GET("/img/*_", func(w http.ResponseWriter, r *http.Request, ps httprouter.Params) {
|
||
|
http.ServeFile(w, r, path.Join(StaticDir, r.URL.Path))
|
||
|
})
|
||
|
router.GET("/js/*_", func(w http.ResponseWriter, r *http.Request, ps httprouter.Params) {
|
||
|
http.ServeFile(w, r, path.Join(StaticDir, r.URL.Path))
|
||
|
})
|
||
|
router.GET("/views/*_", func(w http.ResponseWriter, r *http.Request, ps httprouter.Params) {
|
||
|
http.ServeFile(w, r, path.Join(StaticDir, r.URL.Path))
|
||
|
})
|
||
|
}
|