token-validator: maatma should be the root of token-validator
This commit is contained in:
parent
a4a7b48a4f
commit
e1f7027109
3 changed files with 55 additions and 118 deletions
|
@ -18,7 +18,16 @@ var StaticDir string = "htdocs/"
|
|||
|
||||
func init() {
|
||||
Router().GET("/", func(w http.ResponseWriter, r *http.Request, ps httprouter.Params) {
|
||||
http.ServeFile(w, r, path.Join(StaticDir, "index.html"))
|
||||
http.ServeFile(w, r, path.Join(StaticDir, "maatma.html"))
|
||||
})
|
||||
Router().GET("/auth", func(w http.ResponseWriter, r *http.Request, ps httprouter.Params) {
|
||||
http.ServeFile(w, r, path.Join(StaticDir, "maatma.html"))
|
||||
})
|
||||
Router().GET("/domains", func(w http.ResponseWriter, r *http.Request, ps httprouter.Params) {
|
||||
http.ServeFile(w, r, path.Join(StaticDir, "maatma.html"))
|
||||
})
|
||||
Router().GET("/tunnels", func(w http.ResponseWriter, r *http.Request, ps httprouter.Params) {
|
||||
http.ServeFile(w, r, path.Join(StaticDir, "maatma.html"))
|
||||
})
|
||||
Router().GET("/css/*_", func(w http.ResponseWriter, r *http.Request, ps httprouter.Params) {
|
||||
serveStaticAsset(w, r)
|
||||
|
@ -51,39 +60,6 @@ func init() {
|
|||
serveStaticAsset(w, r)
|
||||
})
|
||||
|
||||
Router().GET("/maatma/", func(w http.ResponseWriter, r *http.Request, ps httprouter.Params) {
|
||||
http.ServeFile(w, r, path.Join(StaticDir, "maatma.html"))
|
||||
})
|
||||
Router().GET("/maatma/auth", func(w http.ResponseWriter, r *http.Request, ps httprouter.Params) {
|
||||
http.ServeFile(w, r, path.Join(StaticDir, "maatma.html"))
|
||||
})
|
||||
Router().GET("/maatma/domains", func(w http.ResponseWriter, r *http.Request, ps httprouter.Params) {
|
||||
http.ServeFile(w, r, path.Join(StaticDir, "maatma.html"))
|
||||
})
|
||||
Router().GET("/maatma/tunnels", func(w http.ResponseWriter, r *http.Request, ps httprouter.Params) {
|
||||
http.ServeFile(w, r, path.Join(StaticDir, "maatma.html"))
|
||||
})
|
||||
Router().GET("/maatma/css/*_", func(w http.ResponseWriter, r *http.Request, ps httprouter.Params) {
|
||||
r.URL.Path = strings.TrimPrefix(r.URL.Path, "/maatma")
|
||||
serveStaticAsset(w, r)
|
||||
})
|
||||
Router().GET("/maatma/fonts/*_", func(w http.ResponseWriter, r *http.Request, ps httprouter.Params) {
|
||||
r.URL.Path = strings.TrimPrefix(r.URL.Path, "/maatma")
|
||||
serveStaticAsset(w, r)
|
||||
})
|
||||
Router().GET("/maatma/img/*_", func(w http.ResponseWriter, r *http.Request, ps httprouter.Params) {
|
||||
r.URL.Path = strings.TrimPrefix(r.URL.Path, "/maatma")
|
||||
serveStaticAsset(w, r)
|
||||
})
|
||||
Router().GET("/maatma/js/*_", func(w http.ResponseWriter, r *http.Request, ps httprouter.Params) {
|
||||
r.URL.Path = strings.TrimPrefix(r.URL.Path, "/maatma")
|
||||
serveStaticAsset(w, r)
|
||||
})
|
||||
Router().GET("/maatma/views/*_", func(w http.ResponseWriter, r *http.Request, ps httprouter.Params) {
|
||||
r.URL.Path = strings.TrimPrefix(r.URL.Path, "/maatma")
|
||||
serveStaticAsset(w, r)
|
||||
})
|
||||
|
||||
flag.StringVar(&StaticDir, "static", StaticDir, "Directory containing static files")
|
||||
}
|
||||
|
||||
|
|
Reference in a new issue