45 lines
1.7 KiB
Go
45 lines
1.7 KiB
Go
package main
|
|
|
|
import (
|
|
"net/http"
|
|
"path"
|
|
|
|
"srs.epita.fr/fic-server/admin/api"
|
|
|
|
"github.com/julienschmidt/httprouter"
|
|
)
|
|
|
|
func init() {
|
|
api.Router().GET("/", func(w http.ResponseWriter, r *http.Request, ps httprouter.Params) {
|
|
http.ServeFile(w, r, path.Join(StaticDir, "index.html"))
|
|
})
|
|
api.Router().GET("/exercices/*_", func(w http.ResponseWriter, r *http.Request, ps httprouter.Params) {
|
|
http.ServeFile(w, r, path.Join(StaticDir, "index.html"))
|
|
})
|
|
api.Router().GET("/events/*_", func(w http.ResponseWriter, r *http.Request, ps httprouter.Params) {
|
|
http.ServeFile(w, r, path.Join(StaticDir, "index.html"))
|
|
})
|
|
api.Router().GET("/teams/*_", func(w http.ResponseWriter, r *http.Request, ps httprouter.Params) {
|
|
http.ServeFile(w, r, path.Join(StaticDir, "index.html"))
|
|
})
|
|
api.Router().GET("/themes/*_", func(w http.ResponseWriter, r *http.Request, ps httprouter.Params) {
|
|
http.ServeFile(w, r, path.Join(StaticDir, "index.html"))
|
|
})
|
|
|
|
api.Router().GET("/css/*_", func(w http.ResponseWriter, r *http.Request, ps httprouter.Params) {
|
|
http.ServeFile(w, r, path.Join(StaticDir, r.URL.Path))
|
|
})
|
|
api.Router().GET("/fonts/*_", func(w http.ResponseWriter, r *http.Request, ps httprouter.Params) {
|
|
http.ServeFile(w, r, path.Join(StaticDir, r.URL.Path))
|
|
})
|
|
api.Router().GET("/img/*_", func(w http.ResponseWriter, r *http.Request, ps httprouter.Params) {
|
|
http.ServeFile(w, r, path.Join(StaticDir, r.URL.Path))
|
|
})
|
|
api.Router().GET("/js/*_", func(w http.ResponseWriter, r *http.Request, ps httprouter.Params) {
|
|
http.ServeFile(w, r, path.Join(StaticDir, r.URL.Path))
|
|
})
|
|
api.Router().GET("/views/*_", func(w http.ResponseWriter, r *http.Request, ps httprouter.Params) {
|
|
http.ServeFile(w, r, path.Join(StaticDir, r.URL.Path))
|
|
})
|
|
}
|